Skip to content

Commit b0258fb

Browse files
init project
1 parent b926890 commit b0258fb

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

brain_games/scripts/brain_calc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ def main():
4444

4545
if correct_answers == 3:
4646
print(f"Congratulations, {name}!")
47+
48+
4749

4850
if __name__ == '__main__':
4951
main()

brain_games/scripts/brain_even.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def main():
3333
break
3434
if correct_answers == 3:
3535
print(f"Congratulations, {name}!")
36+
3637

3738
if __name__ == '__main__':
3839
main()

brain_games/scripts/brain_gcd.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from brain_games.cli import welcome_user
33

44

5-
def gcd(a,b):
5+
def gcd(a, b):
66
while b != 0:
77
a, b = b,a % b
88
return a
@@ -23,7 +23,7 @@ def main():
2323
correct_answers = 0
2424

2525
while correct_answers < 3:
26-
correct_answer,question = get_gcd_questions()
26+
correct_answer, question = get_gcd_questions()
2727
print(f"Question: {question}")
2828
user_answer = input("You answer: ")
2929

@@ -37,6 +37,7 @@ def main():
3737
break
3838
if correct_answers == 3:
3939
print(f"Congratulations, {name}!")
40+
4041

4142
if __name__ == '__main__':
4243
main()

brain_games/scripts/brain_prime.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,19 @@
66
def is_prime(n):
77
if n < 2:
88
return False
9-
for i in range(2, int(n**0.5)+ 1):
9+
for i in range(2, int(n**0.5) + 1):
1010
if n % i == 0:
1111
return False
1212
return True
1313

14+
1415
def get_prime_question():
1516
number = random.randint(2, 100)
1617
correct_answer = 'yes' if is_prime(number) else 'no'
1718
question = str(number)
1819
return correct_answer, question
1920

21+
2022
def main():
2123
name = welcome_user()
2224
print(DESCRIPTION)

brain_games/scripts/brain_progression.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66

77
def generate_progression():
8-
length = random.randint(5,10)
9-
start = random.randint(1,50)
10-
step = random.randint(2,10)
8+
length = random.randint(5, 10)
9+
start = random.randint(1, 50)
10+
step = random.randint(2, 10)
1111

1212
missing_idx = random.randint(0, length -1)
1313

@@ -45,6 +45,7 @@ def main():
4545

4646
if correct_answers == 3:
4747
print(f"Congratulations, {name}!")
48+
4849

4950
if __name__ == '__main__':
5051
main()

0 commit comments

Comments
 (0)