- 1

[code check] cant seem to figure out why this python script doesnt work

var1 = 4 var2 = 7 print("the sum of" var1 "+" var2 "is") text = var1 + var2 print(text)

16th Dec 2018, 11:49 AM
MaxBanter
MaxBanter - avatar
5 Réponses
+ 6
Use commas to separate arguments inside print() print("the sum of", var1, "+", var2, "is")
16th Dec 2018, 11:56 AM
Kishalaya Saha
Kishalaya Saha - avatar
+ 5
It's quite fine, my friend. We've all made these mistakes at some point. Happy learning! 😊
16th Dec 2018, 12:01 PM
Kishalaya Saha
Kishalaya Saha - avatar
+ 3
You can't concate string with integer. Do it like as Kishalaya Saha said
16th Dec 2018, 11:58 AM
Arushi Singhania
Arushi Singhania - avatar
+ 2
Thankyou so much i feel dumb for not realizing i always try to extend as much as i can on my first code in a language to see what works and what doesnt
16th Dec 2018, 12:00 PM
MaxBanter
MaxBanter - avatar
+ 1
Just as an enrichment, here is all you would want to know about print() function in Python, now and in future. https://code.sololearn.com/cTiay1gR16w3/?ref=app
16th Dec 2018, 12:18 PM
Gordon
Gordon - avatar