Python Forum
not finding the resone for the error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
not finding the resone for the error
#1
im currntly lerning about classs and child class and parint


class Car:
	"""a simple attempt to represent a car."""

	def __init__(self,make,model,year):
		self.make = make
		self.model = model
		self.year = year
		self.odometer_reading = 0

	def get_descriptive_name(self):
		long_name = f"{self.year} {self.make} {self.model}"
		return long_name.title()

	def read_odometer(self):
		print(f"this car has {self.odometer_reading} miles on it")

	def update_odometer(self,mileage):
		if mileage >= self.odometer_reading:
			self.odometer_reading = mileage
		else:
			print("you can't roll back an odometer !")

	def increment_odometer(self,miles):
		self.odometer_reading += miles

class ElectricCar(Car):
		"""represent aspects of a car ,specific to electric vehicles"""
	def __init__(self, make, model, year):
           """Initialize attributes of the parent class."""
           super().__init__(make, model, year)



my_tesla = ElectricCar('tesla','model s' , 2019)
print(my_tesla.get_descriptive_name())
Error:
File "C:\Users\alex8\Documents\python\python _work.py\chpter 9\electric_car.py", line 28 def __init__(self, make, model, year): ^ IndentationError: unindent does not match any outer indentation level
tenaks for the help
Reply


Messages In This Thread
not finding the resone for the error - by yukhei - May-21-2020, 02:32 PM
RE: not finding the resone for the error - by Yoriz - May-21-2020, 03:30 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  not finding the resone for the error yukhei 3 1,737 May-22-2020, 03:39 PM
Last Post: deanhystad
  not find the resone it not prints yukhei 3 1,768 May-22-2020, 03:36 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020