Skip to content

Commit d51d3bd

Browse files
committed
pip 8
1 parent 51b415e commit d51d3bd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

brain_games/game_logic.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
def start_game(description, question_func):
2+
23
print("Welcome to the Brain Games!")
34
name = input("May I have your name? ").strip()
45
print(f"Hello, {name}!")
@@ -19,4 +20,4 @@ def start_game(description, question_func):
1920

2021
print("Correct!")
2122

22-
print(f"Congratulations, {name}!")
23+
print(f"Congratulations, {name}!")

brain_games/scripts/brain_even.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import random
22
from brain_games.cli import welcome_user
33

4-
54
def is_even(number):
5+
"""Checks if a number is even."""
66
return number % 2 == 0
77

8-
98
def main():
9+
"""
10+
Runs the "Even" game.
11+
"""
1012
user_name = welcome_user()
1113
print('Answer "yes" if the number is even, otherwise answer "no".')
1214

@@ -19,11 +21,11 @@ def main():
1921
correct_answer = "yes" if is_even(number) else "no"
2022

2123
if user_answer != correct_answer:
22-
print(
23-
f"'{user_answer}' is wrong answer ;(. "
24-
f"Correct answer was '{correct_answer}'.")
25-
print(f"Let's try again, {user_name}!")
26-
return
24+
print(
25+
f"'{user_answer}' is wrong answer ;(. "
26+
f"Correct answer was '{correct_answer}'.")
27+
print(f"Let's try again, {user_name}!")
28+
return
2729

2830
print("Correct!")
2931

0 commit comments

Comments
 (0)