why it say no output..? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why it say no output..?

num_1 ="5" num_2 ="6" total ="num_1 +num_2" print = "total"

4th Jul 2016, 12:35 PM
Mosiur Rahman
Mosiur Rahman - avatar
3 Answers
+ 3
You need to call the print function, like this: print(total). Also, do not use quotes for the variables. I have changed your code, see below: num_1=5 num_2=6 total =num_1+num_2 print(total)
4th Jul 2016, 1:04 PM
James Flanders
+ 2
also you defined 5 and 6 as strings so answer will be 56
5th Jul 2016, 9:47 AM
Oyuncu Doruk
Oyuncu Doruk - avatar
+ 1
the last line wrong... you should call print function.. total = num_1 + num_2 print (total)
4th Jul 2016, 5:24 PM
cyhun