Display a message in python ""

Solved
Tim -  
 Enzo -
Hello,

This may seem like a very simple question for some, so I apologize in advance. I am in my final year of high school and I have an error to correct in a Python script. The teacher wrote: print (Bonjour !). He asked us to find the error, which is: print ("Bonjour !"). But he asked us why we need quotes here, whereas when we do: print (somme) ("somme" is defined in the script), we don't need quotes. HELP and thank you :)

1 réponse

Anonymous user
 
So, I've had a few lessons on Python but I'm not an expert. It seems to me that if you use print("something") it will output what you put between the quotes, and if you use print(something) knowing that this something is in the script, it will show you the value of something. A little example:
If you say that a= "My name is Didier" then you need to use quotes because it's a string
After that you use print(a) normally your final result will be My name is Didier but if you had used print("a") your result would have been a
7
Enzo
 

thank you very much

0