## Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

### Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

# Method with Megan Amendola

hello, can someone explain me when i set gas consumption 35, why the method use_gas called second times, it produce You are run out of gas!???

```Class Car():
doors = 4
wheel = 4
engine = True

def __init__(self, model, year, make = "Honda"):
self.model = model
self.year = year
self.make = make
self.gas = 100
self.is_moving = False

def stop(self):
if self.is_moving:
print("The Car has stopped")
self.is_moving = False
else:

def go(self, speed):
if not self.is_moving:
if not self.is_moving:
print(f"The car is start")
self.is_moving = True
print(f"the car is going {speed} KMH")
else:
print("You are run out of gas!")
self.stop()

def use_gas(self):
self.gas -= 35
if self.gas <= 0:
return False
else:
return True

car_one = Car("Civic", 2022)
car_one.stop()
car_one.go(200)
car_one.go(250)
car_one.go(300)
car_one.stop()
car_one.stop()
```

this is the result

The car is start
the car is going 200 KMH
You are run out of gas!
The Car has stopped
The car is start
the car is going 300 KMH
The Car has stopped
```def go(self, speed):
What stands out to me is that you have 3 calls to the `go` method of over 200 but you only start with enough gas for 100. That may be why you're seeing the car stopped when you're not expecting it to.