Getting A Crazy Module Error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
13th Sep 2021, 6:18 AM
Jason Eyerly
3 Answers
+ 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.
13th Sep 2021, 6:39 AM
Python Learner
Python Learner - avatar
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
14th Sep 2021, 5:11 AM
Jason Eyerly
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
14th Sep 2021, 6:01 AM
Python Learner
Python Learner - avatar