We’ve not yet learnt how to store and use the responses to the questions your code can ask but you can still have some fun getting the user to type in answers to questions.
Here are three suggestions for challenges to work on in order to practise getting input from a user using python.
You don’t need to do all of these challenges: just choose one.
If you can think of a more creative thing to do – go for it – as long as you use input at least 5 times and don’t have any error messages.
- Write code asks 10 different quiz questions about a topic of your choice
Do you know more about football / music / food than your friend? Prove it by writing code that asks questions to which only you know the answers.
- Write code that tells 5 different knock-knock jokes
Try to think of at least one joke yourself
- Write an irritating chatbot that asks lots of silly questions
A chatbot is a computer program pretending to be human. Your chatbot doesn’t have to understand what the user types in – just keep asking them questions.
Page 1: Intro
Page 2: The theory: learn what you need to know as fast as possible.
Page 3: Try it: try out and adapt some working python code snippets.
Page 4: Debug it: Learn how to find and fix common mistakes.
Page 5: Extend it: Choose a project idea to use your newfound python skills.