Skip to content

Instantly share code, notes, and snippets.

@mayankdawar
Created September 24, 2020 19:40
Show Gist options
  • Save mayankdawar/f5d4b23ddca97f1fc1ec7e0643e47746 to your computer and use it in GitHub Desktop.
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.
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