I keep getting
<__main__.Camera object at 0x02C08790>
and I don't know why.
I would like the code to go from Calc_Speed to Counter and then back to Calc_Speed basically in a loop.
class Camera():
distance = 2
speed_limit = 20
number_of_cars = 0
def Calc_Speed(self):
registration = input("Registration Plate: ")
Speeding_List=[]
start = float(input("Start time: "))
end = float(input("End Time: "))
speed = self.distance/(end-start)
print(("Average Speed: ") + str(round(speed, 2)) + (" mph"))
if speed > self.speed_limit:
list3= [str(self.registration)]
Speeding_List.append(list3)
print("Vehicles Caught Speeding: " + str(Speeding_List))
return(program.Counter())
else:
print("Vehicle Not Speeding")
return(program.Counter())
def Counter():
self.number_of_cars = self.number_of_cars + 1
print("Number Of Cars Recorded: " + str(self.number_of_cars))
return(program.Calc_Speed())
program = Camera()
print(program)
Speed_Cameraobject. What do you expect? - DanielSpeed_Cameradefined. Also, you never said what you intend the program to do, so no one can tell you how to make it do what you want. - BrenBarnprinton it. also your functions within your class are not being called. - James Kent