A print and variable question on python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

A print and variable question on python

Hello, when i print anything that is not in a variable inside the function. Does it converts it to a variable? E.g. If i print print("Hello World") Hello World prints as a string, it's not like a new variable is created and then printed, right?

21st Jan 2020, 11:02 PM
Pame
Pame - avatar
4 Answers
+ 6
yes it is a string simply print("Hello World") nothing more
21st Jan 2020, 11:46 PM
BroFar
BroFar - avatar
+ 5
no it is not a variable unless assigned as my_str = "Hello World" print(my_str)
21st Jan 2020, 11:52 PM
BroFar
BroFar - avatar
+ 2
welcome Pame
21st Jan 2020, 11:54 PM
BroFar
BroFar - avatar
+ 1
BroFar thank you so much!
21st Jan 2020, 11:53 PM
Pame
Pame - avatar