d = {'Alice': [50, 61, 66], 'Bob': [80, 61, 66], 'Candy': [88, 75, 90]}
for key, value in d.items():
for score in value:
print(key, score)
for key, value in d.items():
for score in value:
print(key, score)
3天前
for key, value in d.items():
if value > 60:
print(key, value)
# ==> Candy 75
# ==> David 86
if value > 60:
print(key, value)
# ==> Candy 75
# ==> David 86
3天前
s1 = set([1, 2, 3, 4, 5])
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
s3 = {x for x in s2 if x in s1 }
print(s3)
s2 = set([1, 2, 3, 4, 5, 6, 7, 8, 9])
s3 = {x for x in s2 if x in s1 }
print(s3)
2024-03-18
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
L.append('Zero')
L.insert(5, 'Phoebe')
L.insert(5, 'Gen')
print(L)
L.append('Zero')
L.insert(5, 'Phoebe')
L.insert(5, 'Gen')
print(L)
2024-03-18
L = ['Alice', 'Bob', 'Candy', 'David', 'Ellena']
L.append('Zero')
L.insert(5, 'Phoebe')
L.insert(5, 'Gen')
print(L)
L.append('Zero')
L.insert(5, 'Phoebe')
L.insert(5, 'Gen')
print(L)
2024-03-18
sum = 0
while sum <= 9:
sum = sum + 1
ve = sun * sum
print(ve)
while sum <= 9:
sum = sum + 1
ve = sun * sum
print(ve)
2024-03-18
L = [75, 92, 59, 68, 99]
sum = 2
for lint in L
ve = lint / sum
print = (ve)
sum = 2
for lint in L
ve = lint / sum
print = (ve)
2024-03-18