решение мое - неполное
смотри приложение
# coding:utf-8
import os
import sys
def input_data():
"""
Function insert data to list
:return:
"""
l = list()
os.system('cls')
print('(enter - next number; end - end; quit - quit)')
print('-' * 40)
while True:
userinput = sys.stdin.readline().rstrip('\n')
if userinput == 'quit':
sys.exit()
if userinput == 'end':
return (l)
try:
if not type(int(userinput.rstrip('\n'))) == int:
print("Element isn't a number!!!")
else:
l.append(int(userinput))
except:
print("Element isn't a number!!!")
return(l)
def ch_continue():
"""
Function define to continue for user in any cycle
"""
os.system('cls')
x = str(raw_input('\n\tDo you want to continue?(y or n) '))
if x.startswith('y') or x.startswith('Y') or x == '':
cycle()
else:
sys.exit()
def MinusMin(ls):
#l = list()
#l = list(map(lambda x: x - min(ls), ls))
os.system('cls')
if not type(ls) == list:
print("Type isn't a list")
ch_continue()
if ls == []:
print("List is empty!")
ch_continue()
print("list - " + str(ls))
print("Minimum - " + str(min(ls)))
print("-"*40)
#ls = map(lambda x: x - min(ls), ls)
print("Result list - " + str(map(lambda x: x - min(ls), ls)))
def cycle():
"""
Main cycle
:return:
"""
l = input_data()
MinusMin(l)
raw_input()
ch_continue()
if __name__ == '__main__': # if it's main script
while True:
cycle()