Clean Code: Apply flake8-simplify to Python

Also flake8-comprehensions which was added to the CI

For flake8-simplify, there are a few false-positives,
e.g. https://github.com/MartinThoma/flake8-simplify/issues/115
This commit is contained in:
Martin Thoma
2022-03-18 22:27:31 +01:00
parent d43ec589c8
commit 3b2739b8a2
28 changed files with 168 additions and 214 deletions

View File

@@ -98,9 +98,8 @@ def play_game():
else:
print("Tie. No score change.")
cards_left -= 2
if cards_left > 2:
if input("Do you want to continue ").lower().startswith("n"):
break
if cards_left > 2 and input("Do you want to continue ").lower().startswith("n"):
break
if cards_left == 0:
print(
"\nWe have run out of cards. Final score: You:",