0
what is the correct syntax for print?
print("something") or print('something') '' or "" ?
2 Antworten
+ 1
Both print('...') and print("...") are correct, I've explained the difference on this link:
https://www.sololearn.com/discuss/567245/?ref=app
+ 1
Both are correct, use the one you like, usually in python use '', but depending on the case you will need either one or the other, for example, if you want to
print "Hello World with double quotation marks" you would need to write
print(' "Hello World with double quotation marks" ')
// -> "Hello World with double quotation marks"
or otherwise
print (" 'Hello World with double quotation marks' Quotation marks' ")
// -> 'Hello World with double quotation marks'