04: Python: Variables

Extend it:

Use and store data in variables
Python Variables: Use and store data in variables

Now that we’ve learnt how to ask the user a question and store the answer they give in a variable, you can go back and make your code from the output activity slightly more ‘intelligent’ so that it reacts to what the user says.

Here’s a starting point for a chatbot.


There’s only one challenge this time but you can choose whatever questions you want your chatbot to ask.

You must ask at least 5 questions and save the answer to each question into different variables.

5 thoughts on “04: Python: Variables

  • Pingback: Python for beginners: free interactive self marking activities

  • January 5, 2019 at 4:10 am

    please check chalenge one :
    print(β€œHello ” + name + ” an!” )
    (it still gives me an error!)

  • January 5, 2019 at 8:47 am

    Replace the ” an!” with “!” and you should be OK πŸ˜€

  • April 10, 2020 at 3:20 pm

    need help with line 7 where do you put the second + food + ? in the line

    • April 11, 2020 at 8:50 am

      Try printing food + “? I love ” + food + “!”


Leave a Reply

Your email address will not be published. Required fields are marked *