MAINT: Apply pre-commit

Remove byte-order-marker pre-commit check as there would be
many adjustments necessary
This commit is contained in:
Martin Thoma
2022-03-05 09:29:23 +01:00
parent f5e33ae38f
commit e64fb6795c
536 changed files with 6267 additions and 5556 deletions

View File

@@ -19,8 +19,8 @@ def play_game():
time_answer = float(input("How long does the trip take by car "))
except ValueError:
print("Please enter a number.")
car_time = time_difference*train_speed/(car_speed-train_speed)
error_percent = int(abs((car_time-time_answer)*100/time_answer)+.5)
car_time = time_difference * train_speed / (car_speed - train_speed)
error_percent = int(abs((car_time - time_answer) * 100 / time_answer) + 0.5)
if error_percent > 5:
print("Sorry. You were off by", error_percent, "percent.")
print("Correct answer is", round(car_time, 6), "hours")
@@ -36,8 +36,7 @@ def main():
keep_playing = True
while keep_playing:
play_game()
keep_playing = input(
"\nAnother problem (yes or no) ").lower().startswith("y")
keep_playing = input("\nAnother problem (yes or no) ").lower().startswith("y")
if __name__ == "__main__":