I get a NameError when I attempt to execute the following code with any possible input string in Python 3.0:
def onePerLine(str):
for i in str:
print(i)
word=input("Enter a phrase or word: ")
onePerLine(word)
The error is as follows:
Enter a phrase or word: hello
Traceback (most recent call last):File"C:\Users\R\Documents\Python30\func2.py",line 5, in <module> word=input("Enter a phrase or word: ")
File "<string>", line 1, in <module>
NameError: name 'hello' is not defined
How do i fix this and get my code to run? PS: I'm a newbie to python and to programming in general. Any assistance would be appreciated.