+ 1
Getting A Crazy Module Error?
3 ответов
+ 7
Hi Jason!
That's because you're taking 5 inputs instead of 4. For that, you have to change your while condition to attempt <4:
Also, you're missing the last print statement to print the final score.
0
JUMP_LINK__&&__Python__&&__JUMP_LINK Learner Updated the code. I am doing the math the hard way (I can't remember the term for doing the += method) and it's running the code but I'm not passing the test cases.
https://code.sololearn.com/ca28Y472LrkA/?ref=app
0
You have to use the input variable within the loop to take multiple inputs. Right now you're taking input only once. That's the thing you're missing here.
So, it needs to be like this
while attempt <4:
shot = input()
(+=) simply means add ( + ) first and then assign ( = ).
Thats why arithmetic operators comes first and then assignment operator
+= , -= , *= , /= or %=
For example,
x += 1 is similar to x = x+1 and so on