Python2 Saved Program: serene-home

facebook share

Here's the online compiler accompanied with IDE at your service. This is a saved code by one of our users. Try it out or save your own from the IDE page and don't forget to leave a feedback. You can find that at the bottom of the page.


high = 10 
ans = 6

 x = input("enter a numbr between 0 and 10")
 

 
while (int(x) != ans):
  if(int(x)<ans):
    print "Answer is higher"
    continue
  elif(int(x)>ans):
    print "Answer is lower"
    continue
  elif (int(x)==ans):
    print "correct !!!!!!"
    break
  guess= raw_input("enter a numbr between 0 and %d" %high)
Execute

Output

Press the execute button or CTRL + enter to run code.

Inputs