Aug-23-2018, 05:54 AM
hello,
I have created a class 'User':
then I imported the file 'saty.py' in the interactive mode of the interpreter by:
import saty
the file was successfully imported.
now I want to call the single instance of this class 'user1' with all its attributes into the interactive mode of the interpreter. how can I do this?
>>> print ... ?
thanks in advance
I have created a class 'User':
class User: def __init__(self, name, gender, age): self.name = name self.gender = gender self.age = age def __call__(self, name, gender, age): print(name) print(gender) print(age) user1 = User('dany wasser', 'gender: male', 21)I put this class in a file called saty.py
then I imported the file 'saty.py' in the interactive mode of the interpreter by:
import saty
the file was successfully imported.
now I want to call the single instance of this class 'user1' with all its attributes into the interactive mode of the interpreter. how can I do this?
>>> print ... ?
thanks in advance