0

I am getting an EOFError in my code.

I am writing a program to get the user to input some number and count from 1 to that number and print the same. Its pretty simple and I am using a function to do this. My code is as follows; def hide_and_seek(count): for i in range(1, count+1): print(i) print("Ready or not, here I come!") count = int(input("Enter the count:")) hide_and_seek(count) But I am getting error in the statement "count = int(input("Enter the count:"))" Please help. Thanks.

1st Sep 2020, 6:58 PM
NG_
NG_ - avatar
5 Answers
+ 2
The parentheses might remained open in some of your line.Check once.
1st Sep 2020, 7:05 PM
shubham kumar
shubham kumar - avatar
+ 2
First take input and then convert into int type.
1st Sep 2020, 7:07 PM
shubham kumar
shubham kumar - avatar
+ 2
No error for me...! Nethra Gurumurthy Are you not giving any input? Input a number in the pop-up..
1st Sep 2020, 7:07 PM
Jayakrishna 🇼🇳
+ 2
Take all input at the begining, then manage it in your code
1st Sep 2020, 7:34 PM
Nathan Sikati
Nathan Sikati - avatar
+ 1
Thank you everyone. I was trying this code in a sandbox environment and I guess there is some issue with that. I tried the same code in PYthon IDle and it did work fine. Thanks for your answers.
2nd Sep 2020, 11:39 AM
NG_
NG_ - avatar