← Back to User Input
Question 176
Favourite Things
Favourite Things
Ask for a favourite colour with the prompt Colour? and a favourite number with Number? (each ending in a space), convert the number with int(), and print Your colour is <colour> and your number is <number>. Input: two lines, a word then an integer. Both prompts are part of the output and input() does not add a newline, so the prompts and the sentence appear on one line, as shown in Expected Output.
Expected Output:
Colour? Number? Your colour is blue and your number is 7.= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
User Input
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.