File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11def 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 } !" )
Original file line number Diff line number Diff line change 11import random
22from brain_games .cli import welcome_user
33
4-
54def is_even (number ):
5+ """Checks if a number is even."""
66 return number % 2 == 0
77
8-
98def 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
You can’t perform that action at this time.
0 commit comments