Can't understand what python wants from me

O

Oleksiy Khilkevich

Hello, everyone,
This may be a totally noob question, but since I am one, so here is it.

I have the following code (not something much of):
http://paste.debian.net/27204
The current code runs well, but the problem is with input value:
http://paste.debian.net/27205
Ðs you can see, the numbers are ok, but strings and characters cause
"not defined" error.

I've obviously missing something important, but tutorial says nothing
about this.

Thank you for your help.
 
C

Chris Hulan

Hello, everyone,
This may be a totally noob question, but since I am one, so here is it.

I have the following code (not something much of):http://paste.debian.net/27204
The current code runs well, but the problem is with input value:http://paste.debian.net/27205
Ðs you can see, the numbers are ok, but strings and characters cause
"not defined" error.

I've obviously missing something important, but tutorial says nothing
about this.

Thank you for your help.

You want raw_input()

input() expects the string enterd to be Python code, which it evals()
numbers eval to thenmselves

cheers
 
M

mark.seagoe

Hello, everyone,
This may be a totally noob question, but since I am one, so here is it.

For the input function, python is expecting you to input a number or a
string. If you enter 'asd' without the '' then it thinks you are
entering some variable that you've assigned to asd.

Instead of asd, try to enter 'asd'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,297
Messages
2,571,536
Members
48,284
Latest member
alphabetsalphabets

Latest Threads

Top