what is the difference between using print("hello") and "hello"? I mean what difference that it have in the output screen | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the difference between using print("hello") and "hello"? I mean what difference that it have in the output screen

15th Oct 2016, 4:03 PM
Udhav Mohata
Udhav Mohata - avatar
3 Answers
+ 11
If you are writing "hello" to the python console(REPL), then it does not make a difference.But if you are writing a program in a separate file, and then executing(running) the file, then you have to tell python explicitly to print something to the screen using print() function.
15th Oct 2016, 6:21 PM
nisarg joshi
nisarg joshi - avatar
- 1
when u do print ("hello")... it's just prints what u ask Python to print .I.e., hello ...returns just as output....... when u say "hello" to the Python console...it returns u as 'hello' as string...
25th Oct 2016, 5:18 AM
kisu rox
kisu rox - avatar
- 10
no difference at all!
15th Oct 2016, 5:17 PM
Mahmood
Mahmood - avatar