but the below 4 line code comes the error.
I get this error:
Code: Select all
1 2 usr = input('Enter User number : ') 3 fn = input(' Enter First Name : ') 4 print(fn+' is user '+str(usr))
Traceback (most recent call last):
File "/home/keith/test-input.py", line 3, in <module>
fn = input(' Enter First Name : ')
File "<string>", line 1, in <module>
NameError: name 'Keith' is not defined
I don't understand why fn=input(), it want to define the input data Keith as var ?
If I input "Keith" in quote on the input line, it works
I can't be tell users that all text items have to be in quotes
My project, I using a Pi at a fuel tank to collect data of usage at a small bus company.
That 300+ lines code works, At the tank al they have is a number pad and screen.
But somebody wants the reports to names instead of number, So I need to write
a small utils program to add names to the numbers is when this error came up.
Keith aka N1HLK