Skip to content

Commit 1bf565c

Browse files
committed
black edit
1 parent b5653b1 commit 1bf565c

File tree

6 files changed

+19
-12
lines changed

6 files changed

+19
-12
lines changed

brain_games/cli.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
def welcome_user():
5-
print("Welcome to the Brain Games!")
6-
user_name = prompt.string("May I have your name? ")
7-
print(f"Hello, {user_name}!")
8-
return user_name
5+
print("Welcome to the Brain Games!")
6+
user_name = prompt.string("May I have your name? ")
7+
print(f"Hello, {user_name}!")
8+
return user_name

brain_games/game_logic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ def start_game(description, question_func):
1111
user_answer = input("Your answer: ").strip()
1212

1313
if user_answer != str(correct_answer):
14-
print(f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'.")
14+
print(
15+
f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'."
16+
)
1517
print(f"Let's try again, {name}!")
1618
return
1719

brain_games/scripts/brain_calc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44

55
def generate_calculation():
6-
operations = ['+', '-', '*']
6+
operations = ["+", "-", "*"]
77
num1 = random.randint(1, 100)
88
num2 = random.randint(1, 100)
99
operation = random.choice(operations)
1010
question = f"{num1} {operation} {num2}"
1111

12-
if operation == '+':
12+
if operation == "+":
1313
correct_answer = num1 + num2
14-
elif operation == '-':
14+
elif operation == "-":
1515
correct_answer = num1 - num2
1616
else:
1717
correct_answer = num1 * num2

brain_games/scripts/brain_even.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def main():
1919
correct_answer = "yes" if is_even(number) else "no"
2020

2121
if user_answer != correct_answer:
22-
print(f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'.")
22+
print(
23+
f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'."
24+
)
2325
print(f"Let's try again, {user_name}!")
2426
return
2527

brain_games/scripts/brain_games.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33

44
def main():
5-
welcome_user()
5+
welcome_user()
6+
67

78
if __name__ == "__main__":
8-
main()
9+
main()

brain_games/scripts/brain_gcd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ def main():
1717
user_answer = input("Your answer: ").strip()
1818

1919
if not user_answer.isdigit() or int(user_answer) != correct_answer:
20-
print(f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'.")
20+
print(
21+
f"'{user_answer}' is wrong answer ;(. Correct answer was '{correct_answer}'."
22+
)
2123
print(f"Let's try again, {user_name}!")
2224
return
2325

0 commit comments

Comments
 (0)