The following assignment has to be completed in Python 2 Create class in python
ID: 3694382 • Letter: T
Question
The following assignment has to be completed in Python 2
Create class in python
The class will have a name and an engine value
3.The constructor will take a string for the name
The constructor will give a random value between 1 and 3 for the engine
The car class will have a function called race that will get a random number between 0 and 10 and multiply it by the engine value.
It will return this value.
The Car will have a __str__() message that will print a nice message out.
In main you will have a list or tuple of 5 cars.
You will call race on all five cars.
You will print the car’s name and their score for the highest value returned from all the race calls (You may need a new tuple or list).
Explanation / Answer
cars.py
helper.py
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.