Why that code doesn't work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why that code doesn't work?

if print ((float(input(''))) * float (2.0)) works perfectly why then print ((float(input(''))) + float (2.0)) doesn't work at all

16th Apr 2018, 8:04 PM
Walde
3 Answers
+ 2
I copied your post and it worked for me. Did you copy directly from your code or have you typed this? Are you getting an error? If you get really stuck, make your code public and include a link to it here and a SoloLearner will no doubt pick up the issue :)
16th Apr 2018, 8:16 PM
Duncan
Duncan - avatar
+ 1
one thing I can think of is if the first ones input is written with single quotes and the lower is with one double quote
17th Apr 2018, 10:26 AM
Markus Kaleton
Markus Kaleton - avatar
0
The code works for me
16th Apr 2018, 8:08 PM
TurtleShell
TurtleShell - avatar