How can i make so, that user uses input() method for giving a value for argument wheels, to the class Car?:
class Car(object):
def __init__(self, name, wheels):
self.name = name
self.wheels = wheels
first_car = Car()
How can i make so, that user uses input() method for giving a value for argument wheels, to the class Car?:
class Car(object):
def __init__(self, name, wheels):
self.name = name
self.wheels = wheels
first_car = Car()
get the input from the user, pass it to the car
class Car(object):
def __init__(self, name):
self.name = name
... etc etc
user_name = input("What name do you want?")
first_car = Car(user_name)
edit: You can also call the input()
from inside the class:
class Car(object):
def __init__(self):
self.name = input("What name do you want")
first_car = Car()