Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a7752f1

Browse files
style: format code with autopep8
Format code with autopep8 This commit fixes the style issues introduced in b44427d according to the output from Autopep8. Details: None
1 parent b44427d commit a7752f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

‎Drag Racing Game/Drag.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import time
22

3+
34
class Car:
45
def __init__(self, name, top_speed, acceleration):
56
self.name = name
@@ -14,7 +15,8 @@ def accelerate(self):
1415
else:
1516
rpm = self.current_speed / (self.top_speed * (self.gear - 1))
1617
self.current_speed += self.acceleration * self.gear
17-
print(f"{self.name}: {self.current_speed:.2f} km/h (Gear: {self.gear}, RPM: {rpm:.2f})")
18+
print(
19+
f"{self.name}: {self.current_speed:.2f} km/h (Gear: {self.gear}, RPM: {rpm:.2f})")
1820

1921
def shift_gear(self):
2022
if self.gear < 5:
@@ -28,6 +30,7 @@ def race(self):
2830
if self.current_speed >= self.top_speed * 0.8:
2931
self.shift_gear()
3032

33+
3134
if __name__ == "__main__":
3235
car1 = Car("Player Car", top_speed=200, acceleration=20)
3336
car2 = Car("AI Car", top_speed=180, acceleration=18)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /