Skip to content

Commit 569cadb

Browse files
init project
1 parent b0258fb commit 569cadb

6 files changed

Lines changed: 12 additions & 10 deletions

File tree

brain_games/scripts/brain_calc.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ def main():
4444

4545
if correct_answers == 3:
4646
print(f"Congratulations, {name}!")
47-
4847

4948

5049
if __name__ == '__main__':

brain_games/scripts/brain_even.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def main():
2323
print(f"Question: {question}")
2424
user_answer = prompt.string("You answer: ").lower().strip()
2525

26-
if user_answer == correct_answer:
26+
if user_answer == correct_answer:
2727
print("Correct!")
2828
correct_answers += 1
2929
else:
@@ -33,7 +33,7 @@ def main():
3333
break
3434
if correct_answers == 3:
3535
print(f"Congratulations, {name}!")
36-
36+
3737

3838
if __name__ == '__main__':
3939
main()

brain_games/scripts/brain_games.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
21
from brain_games.cli import welcome_user
32

3+
44
def main():
55
welcome_user()
66

brain_games/scripts/brain_gcd.py

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

55
def gcd(a, b):
66
while b != 0:
7-
a, b = b,a % b
7+
a, b = b, a % b
88
return a
99

1010

1111
def get_gcd_questions():
1212
number1 = random.randint(1, 100)
1313
number2 = random.randint(1, 100)
1414
correct_answer = str(gcd(number1, number2))
15-
question = f"{number1} {number2}"
15+
question = f"{number1} {number2}"
1616
return correct_answer, question
1717

1818

@@ -25,7 +25,7 @@ def main():
2525
while correct_answers < 3:
2626
correct_answer, question = get_gcd_questions()
2727
print(f"Question: {question}")
28-
user_answer = input("You answer: ")
28+
user_answer = input("You answer:")
2929

3030
if user_answer == correct_answer:
3131
print("Correct!")
@@ -37,7 +37,7 @@ def main():
3737
break
3838
if correct_answers == 3:
3939
print(f"Congratulations, {name}!")
40-
40+
4141

4242
if __name__ == '__main__':
4343
main()

brain_games/scripts/brain_prime.py

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

44
DESCRIPTION = 'Answer "yes" if given number is prime. Otherwise answer "no".'
55

6+
67
def is_prime(n):
8+
79
if n < 2:
810
return False
911
for i in range(2, int(n**0.5) + 1):
@@ -40,5 +42,6 @@ def main():
4042
if correct_answers == 3:
4143
print(f"Congratulations, {name}!")
4244

45+
4346
if __name__ == '__main__':
4447
main()

brain_games/scripts/brain_progression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def generate_progression():
99
start = random.randint(1, 50)
1010
step = random.randint(2, 10)
1111

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

1414
progression = []
1515
for i in range(length):
@@ -45,7 +45,7 @@ def main():
4545

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

5050
if __name__ == '__main__':
5151
main()

0 commit comments

Comments
 (0)