Inconsistent Output in Google Colab

52 views
Skip to first unread message

İnanç Arın

unread,
Aug 1, 2018, 5:38:58 PM8/1/18
to Project Jupyter
I have the following basic code in Google Colab:

from random import *


number
= randint(1, 100)


guess
= int(input("Enter a guess: "))


while guess != number:
 
if guess > number:
   
print("Enter a smaller value")
 
else:
   
print("Enter a greater value")
  guess
= int(input("Enter a guess: "))


print("You guessed the number")


This loop continues until we guess the number correctly. And after each guess, program directs us for the next guess (like enter smaller/greater number).

Sometimes, I get some inconsistency in the outputs. After I enter a wrong number as input, it should direct me with an output.




After I enter 40 as input, it does not show me the output as shown above. But after I enter the next input (42), it fixes the output screen and shows the missing output as below.



What might be the problem? It is happening all the time.


Bob Smith

unread,
Aug 6, 2018, 6:59:36 PM8/6/18
to Project Jupyter
Reply all
Reply to author
Forward
0 new messages