For your A | This code is not working in Python 3.6 as it works in Python 2(inside Codecademy)


#1
phrase = "A bird in the hand..."

# Add your for loop
for char in phrase:
  if char=="A" or char=="a":
    print ("X,"),
  else:
    print (char,)

output in Python 3.6

X,
 
b
i
r
d
 
i
n
 
t
h
e
 
h
X,
n
d
.
.
.

Process finished with exit code 0

#2

print was updated to a a function call in python3, to print on the same line use end in python3


#3

Will you please explain it with an Example Code ?


#4

Example code isn’t explaining, that is providing the solution.

if i google: python print end i get plenty of examples and explanation on what it is, and how it works, like here:

https://stackoverflow.com/questions/27312273/python-meaning-of-end-in-the-statement-print-t-end/27312325


#5

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