- 2

what is the output of this code? >>>spam="7" >>>spam=spam+"0" >>>eggs=int(spam) + 3 >>>print(float(eggs)) 1-703 2-10.7 3-73.0

1st Jul 2017, 9:27 PM
Sherif
Sherif - avatar
5 Answers
+ 4
This belongs in the quiz factory :P Unless this is from the lessons, in which case, don't ask here, please.
1st Jul 2017, 9:35 PM
Tamra
Tamra - avatar
+ 4
I don't want to tell you outright, sorry. You might see something like this again and not understand what's happening. :( This has something to do with strings (specifically, concatenating/"adding" them) and type casting, so try rereading the lessons that explain these things. Maybe you missed something. If you're still stuck, check the comments of the question. Someone might have an explanation there. Edit: I thought this was in the Python lesson, whoops.
1st Jul 2017, 9:45 PM
Tamra
Tamra - avatar
+ 1
i know yeah ..but how can i pass it lol ??
1st Jul 2017, 9:37 PM
Sherif
Sherif - avatar
0
okay Tamra i get it ..thanks alot for ur help :))
1st Jul 2017, 9:56 PM
Sherif
Sherif - avatar
0
73.0
1st Aug 2022, 3:21 PM
wessam lahmod nados