Created
August 18, 2020 15:43
-
-
Save zukerman19/81159b1703a323ecc9f9f8997258d155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def gather_data(): | |
data = get_data() | |
if data.get('user_numbers') is None: | |
data['user_numbers'] = [] | |
current_numbers = len(data['user_numbers']) | |
numbers_to_add = int(input(f'Текущее количество номеров в системе: {current_numbers}.\n' | |
f'Сколько номеров желаете добавить?\n')) | |
for n in range(current_numbers+1, current_numbers+numbers_to_add+1): | |
new_number = int(input(f"Введите число #{n}:")) | |
data['user_numbers'].append(new_number) | |
save_data(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment