Python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Python

What is the difference between print() and print(a)?

2nd Jul 2022, 8:21 PM
Furious Master
Furious Master - avatar
2 Answers
+ 2
The latter prints the value of 'a'. There is no difference in the functions as they are both the same.
2nd Jul 2022, 8:24 PM
Slick
Slick - avatar
0
print() outputs a newline. print(a) outputs the value of a and then a newline. The difference is whether or not print is given an argument to output before the newline.
3rd Jul 2022, 3:29 PM
Brian
Brian - avatar