Python | Info Tab

/ 7 Jul 2013 /
This is the third, from what I can remember it asks for your name, age and gender, and the proceeds to print it in a sentence describing the variables.


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
def start():
    name = input("Hello young traveler, what may your name be? ")
    sex = input("Are you a boy or a girl?  ")
    age = input("And may I ask how old you are?  ")
    print("Loading...")
    print('''Okay, so from the information that I have gathered,
your name is ''', name, ''' you are a ''', sex, ''' and you're ''', age, ''' years old.''')
    test = input("Am I by any chance mistaken?  ")
    if test == "yes":
        print("Oh, sorry about that! Next time type carefully!")
    elif test == "no":
        print("Well, I don't like to brag, but I am pretty intelligent for a machine!")
    else:
        print("Sorry what?")
start()
 
Copyright © 2010 M(ath)+me, All rights reserved