Why doesn't this string work?


#1

“”“Tell Python to print “Monty Python"
to the console on line 4!””"

pi = Monty Python
Print str(pi)

Please leave the following link in the post so we can find the unit module, else replace it with a link to the exact lesson:

Strings and Console Output


#2

keywords like print are case sensitive.

you only need print and the string you want to print, which is monty python. To make it a string, enclose monty python in quotation marks


#3

Thanks! It worked! But not sure why my other code didn’t work since according to previous instructions, my initial approach could maybe work too.


#4

here:

pi = Monty Python

won’t work, given Monty and Python are undefined variable. If it was a string, and print didn’t have an uppercase letter, it should work indeed


#5

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