/
stoledcat
/
python-project-49
Обзор
Документация
Войти
/
stoledcat
/
python-project-49
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
brain_games/games/progression.py
21 строка
628 B
stoledcat
Update progression.py
02 окт 2023, 23:27
Не верифицирован
02 окт 2023, 23:27
4d3cea7
Код
Авторство
О чём код?
import random DESCRIPTION = 'What number is missing in the progression?' def generate_question(): start_number, stop_number, step = (random.randint(2, 30) for i in range(3)) stop_number = (start_number + stop_number + step) * 4 question = list(range(start_number, stop_number, step)) return question def start_function(): question = generate_question() len_question = len(question) index_answer = random.choice(range(0, len_question)) right_answer = question[index_answer] question[index_answer] = '..' question = ' '.join(map(str, question)) return question, str(right_answer)