Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- your_age = int(input("How old are you?: "))
- if your_age <= 6:
- print("Perfect I want to find out about picture books that children like.")
- your_book_choice=input("What is your favourite picture book?: ")
- print ("Good choice, I love",your_book_choice,"too! Lots of lovely colourful pictures to look at.")
- elif your_age <=10:
- print("Perfect I want to find out about story books that children like.")
- your_book_choice=input("What is your favourite story book?: ")
- print ("Good choice, I love",your_book_choice,"too! A lovely story book.")
- elif your_age <=16:
- print("Perfect I want to find out about novels you like.")
- your_book_choice=input("What is your favourite novel?: ")
- print ("Good choice, I love",your_book_choice,"too! A lovely novel.")
- else:
- print("Thanks for helping - but only children can answer this survey.")
- #Use elif statements to modify the code so that different age ranges of children get different questions.
- #For 6 and under it asks about their favourite picture books
- #For 6-10 it asks their favourite story book
- #For 10-16 it asks for their favourite novel
- #Hint if you are using <= operators then start with the youngest group (6) and work your way up. THe catch all "else" for adults should stay the same.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement