忽略题目要求,这样可以么
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
if 'Alice' in d:
d.pop('Alice')
print('Delete sucessfully')
else:
print('STUDENT IS NOT EXIST')
d = {
'Alice': 45,
'Bob': 60,
'Candy': 75,
'David': 86,
'Ellena': 49
}
if 'Alice' in d:
d.pop('Alice')
print('Delete sucessfully')
else:
print('STUDENT IS NOT EXIST')
2023-01-13
举报