Confused in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Confused in python

What is the difference between declaring and displaying when writing comments in python?

18th Aug 2023, 3:06 PM
Hajeongwoo
3 Answers
+ 6
Declaring means to declare the variable Like a = "5" // it means you declare the variable 'a' and put the value 5 in variable a And display means just get the ouput like you declare the variable, now how can you display the output in your screen so, if we want to see the output/display the output in your screen then we use print function print(a) Now, you see in comment section like this: # declare the variable a and store the value '5' in a variable a = 5 # display the a variable print(a) Hope you understand.
18th Aug 2023, 3:35 PM
Sakshi
Sakshi - avatar
+ 3
Hajeongwoo Welcome. Happy to help 😊
18th Aug 2023, 3:38 PM
Sakshi
Sakshi - avatar
+ 1
Wow thank you so much :)
18th Aug 2023, 3:37 PM
Hajeongwoo