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.bubbleClick 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.bubbleUsing input with math
User input comes in as text. Use number() to convert it for math:
calc-input.bubbleBuilding a simple quiz
Combine ask with if to make an interactive quiz:
quiz.bubbleExercise
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.bubbleQuiz
Question 1 of 3
Which command prompts the user for input?