+ 1
Why does this code not work: value=[1] print("I have")+(len(value))+("egg")
value=[1] print("I have")+(len(value))+("egg")
2 Answers
+ 4
because you closed brackets too early.
your print function ends after printing "I have", and then it adds len() to print's return, then adds a string to integer and here it crashes. try this:
print("I have " + str(len(value)) + " egg")
0
Thanks!