7.5k views
3 votes
HELP!! I keep getting an EOFError on line 6 while trying to run my code in python.

my code-

line 1: num = int(input("Enter a number: "))

line 2: c=0

line 3: sum=0

line 4: while (num<100):

line 5: sum=sum+num

line 6: num = int(input("Enter a number: "))

line 7: c=c+1

line 8: print("Sum: " +str(sum))

line 9: print("Numbers Entered: "+str(c))

1 Answer

0 votes

I'm almost certain you were getting an EOF error because you were asking for too much input. My code works for me. Best of luck.

HELP!! I keep getting an EOFError on line 6 while trying to run my code in python-example-1