Created
September 24, 2020 19:40
-
-
Save mayankdawar/f5d4b23ddca97f1fc1ec7e0643e47746 to your computer and use it in GitHub Desktop.
Define a class called Bike that accepts a string and a float as input, and assigns those inputs respectively to two instance variables, color and price. Assign to the variable testOne an instance of Bike whose color is blue and whose price is 89.99. Assign to the variable testTwo an instance of Bike whose color is purple and whose price is 25.0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Bike: | |
def __init__(self,col,pr): | |
self.color = col | |
self.price = pr | |
testOne = Bike('blue',89.99) | |
testTwo = Bike('purple',25.0) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment