+ 2

This may be a silly question but what is the difference between a string with the quotations and using print?

8th Aug 2016, 1:56 AM
Jonathan Duncan
Jonathan Duncan - avatar
2 Respostas
+ 2
you have to use commands to make python print text for you , but in python idle of you type for example "hello world" this is shown as a result with single quot marks in the idle but it will not be shown in an executable program .
9th Aug 2016, 2:21 AM
Mohammad Amin Delshad
Mohammad Amin Delshad - avatar
+ 1
print("This is a string") is the correct syntax for a python program. Python ran from the command line just assumes you want to print a lone string when you put it in.
8th Aug 2016, 3:41 PM
Thomas Mann
Thomas Mann - avatar