Menu

So far, your programs have worked with values you typed into the code. The ask command lets your program get input from the person running it.

The ask command

ask displays a prompt and waits for the user to type something:

ask.bubble

Click Run, then type your name in the input box and press Enter.

Multiple questions

You can ask as many questions as you need:

multi-ask.bubble

Using input with math

User input comes in as text. Use number() to convert it for math:

calc-input.bubble

Building a simple quiz

Combine ask with if to make an interactive quiz:

quiz.bubble

Exercise

Exercise

Ask the user for their favorite food, then print "Yum! I love [food] too!" — for example if they type "pizza", the output after the prompt should be: Yum! I love pizza too!

exercise.bubble

Quiz

Question 1 of 3

Which command prompts the user for input?