Skip to content

Commit 5ac337d

Browse files
committed
new brain-even
1 parent 3ba0c5b commit 5ac337d

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed
-20 Bytes
Binary file not shown.

brain_games/scripts/brain_even.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ def main():
77
ROUNDS_COUNT = 3
88

99

10-
def generate_round():
11-
number = random.randint(1, 100)
12-
question = str(number)
13-
correct_answer = "yes" if number %2 == 0 else "no"
14-
return question, correct_answer
15-
1610
print("Welcome to the Brain Games!")
1711
name = prompt.string("May I have your name?")
1812
print(f"Hello, {name}!")
@@ -36,6 +30,13 @@ def generate_round():
3630
print(f"Congratulations, {name}!")
3731

3832

33+
def generate_round():
34+
number = random.randint(1, 100)
35+
question = str(number)
36+
correct_answer = "yes" if number %2 == 0 else "no"
37+
return question, correct_answer
38+
39+
3940
if __name__ == "__main__":
4041
main()
4142

0 commit comments

Comments
 (0)