What we will be the code for python 3.x?


#1
phrase = "my name is Anthony Mark"

for char in phrase:
    if char == "A" or char == "M":
        print ("x",)
    else:
        print (char,)


print()

when i am typing this code on pycharm it prints all the characters on a new line.


#2

you need to use end:

https://stackoverflow.com/questions/2456148/python-print-end


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.