Please who can tell me why interpreter keep saying word is not defined? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

Please who can tell me why interpreter keep saying word is not defined?

>>> word = input("enter a word:") enter a word:cheese >>> print(word + 'shop') NameError: name 'word' is not defined 😑 >>>

15th Oct 2017, 3:48 AM
Dzoyem Barry
Dzoyem Barry - avatar
2 Answers
+ 5
oh, lemme try
15th Oct 2017, 3:53 AM
Dzoyem Barry
Dzoyem Barry - avatar
+ 2
Maybe try putting that in a .py file instead, then running it.
15th Oct 2017, 3:51 AM
LunarCoffee
LunarCoffee - avatar