when I loop through the characters (char), am i still printing them out as a whole string sentence? Or is each letter a string concatenated together?

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

for char in phrase:
  if char == 'A' or char=='a':
    print 'X',
    print char,




A \n character is written at the end,
unless the print statement ends with a comma.

so you are printing the individual characters/letters of string, but because your print ends with , python doesn’t add a newline character (\n) at the end of string


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