我也感覺,加上T這個(gè)大元組,應(yīng)該是有4個(gè)元組吧。
2020-11-26
T = (100, 69, 29, 100, 72, 99, 98, 100, 75, 100, 100, 42, 88, 100)
print(T.count(100))
print(T.count(100))
2020-11-26
list=[]
for i in range(10):
list.append(i)
print(tuple(list))
for i in range(10):
list.append(i)
print(tuple(list))
2020-11-26
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
N = [89,72,88,79,99]
dictA=dict(zip(L,N))
dictB=sorted(dictA, key=dictA.get, reverse = True)
print(dictB)
N = [89,72,88,79,99]
dictA=dict(zip(L,N))
dictB=sorted(dictA, key=dictA.get, reverse = True)
print(dictB)
2020-11-26
# Enter a code
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(squre, 2))
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(squre, 2))
2020-11-23
# Enter a code
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(wide, 2))
lengh = 3.14
wide = 1.57
squre = lengh * wide
print(round(wide, 2))
2020-11-23
l=['Alice', 'Bob', 'Candy', 'David', 'Ellena']
l[0]='Ellena'
l[1]='Alice'
l[-1]='Bob'
print(l)
l[0]='Ellena'
l[1]='Alice'
l[-1]='Bob'
print(l)
2020-11-23
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
print('\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.')
Whether it's nobler in the mind to suffer.''')
print('\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.')
2020-11-21
# 方法1
list = [i ** 2 for i in range(1, 10)]
print(sum(list))
# 方法2
list2 = [*range(1, 10)]
def square_of_sum(list):
sum = 0
for num in list:
sum += num**2
return sum
sum = square_of_sum(list2)
print(sum)
list = [i ** 2 for i in range(1, 10)]
print(sum(list))
# 方法2
list2 = [*range(1, 10)]
def square_of_sum(list):
sum = 0
for num in list:
sum += num**2
return sum
sum = square_of_sum(list2)
print(sum)
2020-11-21
# 方法1
list = [i**2 for i in range(1,10)]
print(sum(list))
# 方法2
list2 = [*range(1,10)]
def square_of_sum(list):
sum = 0
for num in list:
sum += num
return sum
sum = square_of_sum(list2)
print(sum)
list = [i**2 for i in range(1,10)]
print(sum(list))
# 方法2
list2 = [*range(1,10)]
def square_of_sum(list):
sum = 0
for num in list:
sum += num
return sum
sum = square_of_sum(list2)
print(sum)
2020-11-21