J
J
Julia2014-01-17 19:36:07
Python
Julia, 2014-01-17 19:36:07

Data entry in Python

The question is, I'm trying to enter data about a person, but an error appears.

class Gui: # будущее гуи, получает данные о спортсмене
    # и передает в класс Person
   
   def input(self):
         self.inputName =input("name")
         return self.inputName
 
the_app=Gui() 
print the_app.input()

What am I doing wrong?
Maybe not in the topic, but maybe you should use __str__ ?
Traceback (most recent call last): File "/home/julia/COURSEWORK/person.py", line 34, in print the_app.input() File "/home/julia/COURSEWORK/person.py", line 29, in input self.inputName =input("name") File "", line 1, in NameError: name 'j' is not defined

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question