File tree Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Expand file tree Collapse file tree 2 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,9 @@ def main():
2424
2525 if str (answer ) != str (correct_answer ):
2626 print (
27- f"'{ answer } ' is wrong answer ;(. "
28- f"Correct answer was '{ correct_answer } '."
29- )
27+ f"'{ answer } ' is wrong answer ;(. "
28+ f"Correct answer was '{ correct_answer } '."
29+ )
3030 print (f"Let's try again, { name } !" )
3131 return
3232
Original file line number Diff line number Diff line change 33
44
55def is_prime (n ):
6- ## Проверяет, является ли число простым
6+ # Проверяет, является ли число простым
77 if n < 2 :
88 return False
99 for i in range (2 , int (n ** 0.5 ) + 1 ):
@@ -13,19 +13,19 @@ def is_prime(n):
1313
1414
1515def generate_question ():
16- ## Создает вопрос и правильный ответ
16+ # Создает вопрос и правильный ответ
1717 number = random .randint (1 , 100 )
18- ## Генерация случайного числа от 1 до 100
18+ # Генерация случайного числа от 1 до 100
1919 correct_answer = 'yes' if is_prime (number ) else 'no'
2020 return str (number ), correct_answer
2121
2222
2323def game_logic ():
2424 return {
2525 'instructions' : (
26- 'Answer "yes" if given number is prime. '
27- 'Otherwise answer "no".'
28- ),
26+ 'Answer "yes" if given number is prime. '
27+ 'Otherwise answer "no".'
28+ ),
2929 'get_question_and_answer' : generate_question
3030 }
3131
You can’t perform that action at this time.
0 commit comments