0

Why EOF errors ?

Look at this Python code and see why the 8 line is wrong? thanks! https://code.sololearn.com/cetsXi8DetXo/?ref=app

30th Aug 2020, 4:05 AM
sweetswing2460
3 Answers
+ 3
Remember that this is not a IDE this is unattractive code playground So try same in pydroid you would not get any error
30th Aug 2020, 4:53 AM
Ayush Kumar
Ayush Kumar - avatar
+ 1
Check it dont enter numbers. If u enter quit then its working . What Output u expecting import random; times = 0; n = random.randint(1,30); print("guess the number, Enter \"quit\" to exit") while True : number = input("enter a number between 0 and 30") if number == 'quit': print ("goodbye") break if(not number.isdigit()) : print ("Not up to specificatin,start again") continue times += 1 x = int(number ) if n == x: print ("goodjob,the number is:",x) print ("guess the "+str(times)+"times ") break elif n > x: print (x,'big') elif n < x: print (x,'small')
30th Aug 2020, 4:25 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
30th Aug 2020, 6:35 AM
Oma Falk
Oma Falk - avatar