+ 1
from tutorial Python 3 quiz: Input function
word = input("enter a word: ") print(word + " shop") When prompted I enter: cheese My output is then "Enter a word: Cheese shop", am I missing something or why is the answer and all other comments showing only 'Cheese shop', how did 'Enter a word:' get dropped?
3 Answers
+ 2
Simply by
word = input()
0
After the ":" type "\n". "\n" moves the cursor to the next line
0
"Enter a wordâ is the instruction that your program gives to readers. You can see that itâs an instruction because it is inside the () after input. If you follow this instruction and enter âcheeseâ, then this becomes the value assigned to âwordâ. Now word is equal to cheese, so word+shop becomes cheese+shop.