0
in [Variables], ' ' & " " difference?
Is there a difference in the use of ' '(quotation marks) and " "(double quotation marks) in Variables? ex) name = John age = 24 print(name+' is '+age+' years old') print(name+"is"+age+"years old") is this right??
5 ответов
+ 3
No, it isn't right.
Values must be in double or single quotes.
if not, it will raise Name error
Do this...
name = "John"
age = "24"
print(name+' is '+age+' years old')
print(name+"is "+age+"years old")
Not much different between ' ' and " "
a little different is according to Jay Matthews said.
+ 3
Please always tag the language you're asking about.
This seems to be about python. In python single and double quotes are interchangeable in almost all situations as long as opening and closing quotes are the same.
Jay pointed out the exception above.
+ 1
Myo Thuzar okay Thank you so much!
+ 1
Simon Sauter oh, sorry. It was my first question in Sololearn, so I didn't know that. I'll keep in mind what you pointed out. Thank you very much!
0
Jay Matthews oh, now I see.. Thank you so much!