If i define class car then how to put methods to the user to assign object in that class? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

If i define class car then how to put methods to the user to assign object in that class?

30th Oct 2018, 3:26 AM
Pranay Bhoir.
Pranay Bhoir. - avatar
3 Antworten
+ 1
prop = input("Input a value: ") car = Car(prop) In Car class: def __init__(self, prop):
30th Oct 2018, 5:02 AM
Zeke Williams
Zeke Williams - avatar
0
Could you describe what you mean by "put methods to the user"? My guess right now is to say that if your class is Car, make an object like so: car = Car()
30th Oct 2018, 3:58 AM
Zeke Williams
Zeke Williams - avatar
0
it should ask the user to assign the value to the objects
30th Oct 2018, 4:14 AM
Pranay Bhoir.
Pranay Bhoir. - avatar