标签:lang lse 题目 png turn mic com put split
def AlterList(alist):
count = len(alist)
for i in range(count):
if alist[i] % 2 == 0:
alist[i] = int(alist[i] / 2)
else:
alist[i] = alist[i]** 2
return sorted(alist)
alist = list(map(int,input("Enter a list:\n").split( )))
alter_list = AlterList(alist)
print(alter_list)
1 2 3 4
[1, 1, 2, 9]
标签:lang lse 题目 png turn mic com put split
原文地址:https://www.cnblogs.com/sinlearn/p/12830162.html