- 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)
5 Réponses
+ 6
Use commas to separate arguments inside print()
print("the sum of", var1, "+", var2, "is")
+ 5
It's quite fine, my friend. We've all made these mistakes at some point. Happy learning! 😊
+ 3
You can't concate string with integer.
Do it like as Kishalaya Saha said
+ 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
+ 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