0

what is the correct syntax for print?

print("something") or print('something') '' or "" ?

27th Jul 2017, 11:12 AM
Arkaprava Majumder
Arkaprava Majumder - avatar
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
27th Jul 2017, 11:17 AM
God Usopp
God Usopp - avatar
+ 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'
27th Jul 2017, 4:49 PM
Orlando Bohorquez
Orlando Bohorquez - avatar