Friday, 29 April 2016

34. pre-Cognition

#Pre-cognition

# Import the modules
import random

a=0
b=0

while True:
    print ('Think of a number from 1 to 9')
    ANS = int(input())
    answers = random.randint(1,9)

    if ANS == answers:
        a=a+1
       
    elif ANS != answers:
        b=b+1

    print (answers)    
    print ('')
    print ('YES:')
    print (a)
    print ('NO:')
    print (b)
    print ('')