Feb-11-2021, 02:55 PM
(This post was last modified: Feb-11-2021, 03:31 PM by snippsat.
Edit Reason: Added code tag
)
Hi Team,
I am beginner in Python and below is my code. I want to print some content in specific format with below code but it is not printed as mention. it will be helpful if someone help to resolve it.
Expected Output:
I am beginner in Python and below is my code. I want to print some content in specific format with below code but it is not printed as mention. it will be helpful if someone help to resolve it.
1 2 3 4 5 |
f = open (r "C:\Users\emanpos\bbuser.txt" , "r" ) for x in f: print ( "<Number>" ) print ( " %s%s%s" % ( "<Number>" , x, "</Number>" )) print ( '</Number>' ) |
Output:<Number>
<Number>abc</Number>
</Number>
But Output comes as below.Output:<Number>
<Number>abc
</Number>
</Number>