+ 1
Question about classes and objects in python
How can I take an input from the user and make it the name of an object for a class. For instance I have a class named Employee to keep track of employees and I want the user to input the name of a new employee and make a new object for that employee
6 Respostas
0
Sorry forgot to mention it takes 3 arguments ( except self) here is my code so far
class Employee:
def __init__(self, name, points,infraction):
self.name = name
self.points[] = points[]
self.infraction[] = []
input = input("new employee or existing one")
if input == new:
x = input("employee name")
0
I will have them add info into the points and infraction lists later
/as needed so would that be in a method in the class or a passed argument?
0
Ok thanks