题解 | #删除好友#
删除好友
https://www.nowcoder.com/practice/656f7d09fe9c4d78919e7cc2b4a19c81
import sys
friends = input().split()
friend_to_remove = input()
if friend_to_remove in friends:
# 如果相等删除
friends.remove(friend_to_remove)
else:
print("要删除的好友不在列表中")
print(friends)
查看22道真题和解析