Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while True:
- n = input('Введите элементы массива, разделенные пробелом: ')
- m = n.split(' ')
- if len(m) % 2 != 0:
- print('Массив должен содержать четное количество элементов')
- else:
- break
- n = []
- for i, item in enumerate(m):
- if i < int(len(m) / 2):
- n.append(int(item) + 1)
- else:
- n.append(int(item) * 2)
- print('Измененный массив: ', n)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement