已采纳回答 / yunfan123
a=list(map(int,input().strip().split())) # 1 2 3 4 5 -1 -2 -3 -4 -5 c=list(filter(lambda x:x>=0,a)) b=list(filter(lambda x:x<0,a)) print(c,b)# output [1,2,3,4,5],[-1,-2,-3,-4,-5]
2021-03-17
# Enter a code
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
names.insert(0,'Ellena')
names.pop(2)
names[-1] = 'Bob'
print(names)
names = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
names.insert(0,'Ellena')
names.pop(2)
names[-1] = 'Bob'
print(names)
2021-03-17
d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for key in d:
value=d[key]
for score in value:
print(key,score)
for key in d:
value=d[key]
for score in value:
print(key,score)
2021-03-17
# Enter a code
# -*- coding: UTF-8 -*-
# Enter a code
# -*- coding: UTF-8 -*-
#age = int(input('请输入年龄 '))
age = 6
if age >= 18:
print('成年人')
elif 6 <= age <= 18:
print('青少年')
elif 3 <= age <= 6:
print('小孩子')
elif age <= 3:
print('婴儿')
else:
print('出现错误')
# -*- coding: UTF-8 -*-
# Enter a code
# -*- coding: UTF-8 -*-
#age = int(input('请输入年龄 '))
age = 6
if age >= 18:
print('成年人')
elif 6 <= age <= 18:
print('青少年')
elif 3 <= age <= 6:
print('小孩子')
elif age <= 3:
print('婴儿')
else:
print('出现错误')
2021-03-17
d = {
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
l=[50, 61, 66],[80, 61, 66],[88, 75, 90]
print(l[0])
n=0
for v2 in d:
d[v2] = l[n]
print(d,end='\n')
'Alice': [45],
'Bob': [60],
'Candy': [75],
}
l=[50, 61, 66],[80, 61, 66],[88, 75, 90]
print(l[0])
n=0
for v2 in d:
d[v2] = l[n]
print(d,end='\n')
2021-03-17
num=0
sum=0
while num<=1000:
if num%2==0:
sum+=num
num+=1
else:
num += 1
continue
print('sum=',sum)
sum=0
while num<=1000:
if num%2==0:
sum+=num
num+=1
else:
num += 1
continue
print('sum=',sum)
2021-03-16
s1 = 'ABC'
s2 = '123'
s3 = 'abc'
for x in s1:
for y in s2:
for z in s3:
print(x+y+z)
s2 = '123'
s3 = 'abc'
for x in s1:
for y in s2:
for z in s3:
print(x+y+z)
2021-03-16
已采纳回答 / 幕布斯9526405
# Enter a codename=['Alice', 'Bob', 'Candy', 'David', 'Ellena'] names=['Alice', 'Bob', 'Candy', 'David', 'Ellena'] score=[89,72,88,79,99]scores=[89,72,88,79,99]scores.sort()y=0for a in scores: x=0 for b in score: if score[x]==scores[y]: ...
2021-03-15
# Enter a code
a = r'''"To be,or not to be":that is the question.
Whether it's nobler in the mind to suffer.'''
print (a)
a = r'''"To be,or not to be":that is the question.
Whether it's nobler in the mind to suffer.'''
print (a)
2021-03-15