Skip to content

Commit 3330d13

Browse files
committed
fix linter error
1 parent fd17a68 commit 3330d13

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

brain_games/games/brain_calc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import random
1+
from random import randint
22
from brain_games.sample import samples
33

44

@@ -7,8 +7,8 @@
77

88
def type_brain_calc():
99
correct_answer = ''
10-
first_number = random.randint(1, 25)
11-
sec_number = random.randint(1, 25)
10+
first_number = randint(1, 25)
11+
sec_number = randint(1, 25)
1212
arithmetic_operation = random.choice(['+', '-', '*'])
1313
match arithmetic_operation:
1414
case '+':

brain_games/games/brain_even.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import random
1+
from random import randint
22
from brain_games.sample import samples
33

44

55
CON_ANSWER = 'Answer "yes" if the number is even, otherwise answer "no".'
66

77

88
def type_brain_even():
9-
first_number = random.randint(1, 50)
9+
first_number = randint(1, 50)
1010
corr_ans = 'yes' if first_number % 2 == 0 else 'no'
1111
return (corr_ans,
1212
f'Question: {first_number}')

brain_games/games/brain_gcd.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import random
1+
from random import randint
22
from brain_games.sample import samples
33

44

55
CON_ANSWER = 'Find the greatest common divisor of given numbers.'
66

77

88
def type_brain_gcd():
9-
frs_num = random.randint(1, 50)
10-
sec_num = random.randint(1, 50)
9+
frs_num = randint(1, 50)
10+
sec_num = randint(1, 50)
1111
re = []
1212
max_num = max(frs_num, sec_num)
1313
for i in range(1, max_num + 1):

brain_games/games/brain_prime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import random
1+
from random import randint
22
from brain_games.sample import samples
33

44

55
CON_ANSWER = 'Answer "yes" if given number is prime. Otherwise answer "no".'
66

77

88
def type_brain_prime():
9-
num = random.randint(1, 50)
9+
num = randint(1, 50)
1010
re = []
1111
for i in range(1, num + 1):
1212
if num % i == 0:

brain_games/games/brain_progression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import random
1+
from random import randint
22
from brain_games.sample import samples
33

44

55
CON_ANSWER = 'What number is missing in the progression?'
66

77

88
def type_brain_progression():
9-
first_num = random.randint(1, 50)
9+
first_num = randint(1, 50)
1010
re = []
11-
range_progressing = random.randint(5, 10)
12-
sec_num = random.randint(1, 5)
11+
range_progressing = randint(5, 10)
12+
sec_num = randint(1, 5)
1313
for _ in range(range_progressing):
1414
re.append(str(first_num))
1515
first_num += sec_num

brain_games/sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import prompt
1+
from prompt import string
22

33

44
NUMBERS_OF_ATTEMPTS = 3
55

66

77
def samples(condition_answer, answ_and_qest, answ_and_qest2, answ_and_qest3):
88
print('Welcome to the Brain Games!')
9-
name = prompt.string('May I have your name? ')
9+
name = string('May I have your name? ')
1010
print(f'Hello, {name}!')
1111
number_of_successful_attempts = 0
1212
print(condition_answer)

0 commit comments

Comments
 (0)