Monday, 11 January 2016

17 Can a bot be aleatorial?

# Import the modules
import sys
import random
import time

print ('Can a bot be aleatorial?')

ans = True

while ans:
   
    answers = random.randint(1,9)
   
    if answers == 0:
        sys.exit()
   
    elif answers == 1:
        print ('1')
        time.sleep(1)
   
    elif answers == 2:
        print ('2')
        time.sleep(1)
   
    elif answers == 3:
        print ("3")
        time.sleep(1)

    elif answers == 4:
        print ("4")
        time.sleep(1)
       
    elif answers == 5:
        print ("5")
        time.sleep(1)
   
    elif answers == 6:
        print ("6")
        time.sleep(1)
       
    elif answers == 7:
        print ("7")
        time.sleep(1)
       
    elif answers == 8:
        print ("8")
        time.sleep(1)
       
    elif answers == 0:
        print ("0")
        time.sleep(1)
       
    elif answers == 8:
        print ("8")
        time.sleep(1)
       
    elif answers == 9:
        print ("9")
        time.sleep(1)