First program help 02-22-2014, 07:54 PM
#1
Thanks for taking the time to read this. I am teaching myself to use python. I get ADD sometimes so I need to do things to keep me learning and my attention focused on the goal. So I decided to try to program a madlib for my kids. I know this is may seem real simple but I am a little confused on one part. I am trying to take a age input and then make a function to make thier age look rediculous. I will post what I am working with. Everything else works except what I am trying to do with the age. I also am open to constructive feedback on if there are ways I do this properly/cleaner.
Thanks to Ex094 your article helped me get started.
Thanks to Ex094 your article helped me get started.
Code:
#My first program using some of the basic skills I have learned from Ex094
#and "A Byte of Python" by Swaroop C H.
#Wanted to try making a madlib for my kids.
you = input('What is your name: ')
#What i at trying to do is make my kids put in there age but when the madlib writes,
#I want it to be rediculous
#Below is what I am having a problem with
age = input('How old are you: ')
x = age
y = 33
z = sum(x + y)
family = input('What is the name of a family member: ')
animal = input('Choose a animal: ')
verb = input('Pick a verb: ')
noun = input('Choose a noun: ')
word = input('Pick a random word: ')
print('One day {} who is {} years old, was playing at the park with {}'.format(you, z, family))
print('When all of a sudden a giant {} jumped out of the bushes and said {}'.format(animal, word))
print('They were so shocked that they tripped over a {} and yelled {}'.format(noun, verb))
s = input('Did you laugh?: ')
if s == 'yes':
print('Your funny')
if s == 'no':
print('Should have picked funnier words')
![[+]](https://sinister.li/images/modern/collapse_collapsed.png)

