Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+4 votes

Hello, I have a question, so, routine practice 1, 1st question ,i am getting this error in moodle, but when i run it in thonny it works perfectly fine!

Error
Traceback (most recent call last):
File "tester.python3", line 13, in

main()

File "tester.python3", line 10, in main

circumference = float(input("Circumference: "))

File "tester.python3", line 3, in input

s = __saved_input__(prompt)

EOFError: EOF when reading a line

Testing was aborted due to error.
Your code must pass all tests to earn any marks. Try again.

asked in CSC201 Spring 2021 by (1 point)

2 Answers

+2 votes
 
Best answer

Hi,
So,the problem is that you are supposed to calculate the circumference
You are asking the user to enter it, but if you KNOW the radius, then you can tell them what the circumference is
The error happens because Moodle only feeds ONE number (the radius) into your program
and your code asks for a second number, but Moodle doesn't type it in, because there is no second number to type in
So, you should change it to
circumference = (expression to calculate circumference)

This asnwer that i said was explained by Dr. Stonedahl, and all the credit goes to him!!

Thank you!

answered by (1 point)
selected by
+1 vote

Actually, you are supposed to calculate for the Routine Practice 4 1st question. So, as circumference is 2.pi.radius, give the statement to input radius and give the calculation for circumference.

circumference = round (math.piradius2, 2)
Don't forget to include round function in your program.

answered by (1 point)
...