一、需求
1)新建名片(姓名、电话、QQ、邮箱)
2)显示全部名片(修改)
3)查询名片
二、代码实现
import re
state = True
bussinessCard = {}
# 新建名片
def create_card():
tel_istrue = True
qq_istrue = True
mail_istrue = True
name = str(input("请输入您的姓名:"))
while tel_istrue:
tel = str(input("请输入您的电话:"))
ret_tel = re.match(r"^1[35678]\d{9}$", tel)
if ret_tel:
tel_istrue = False
else:
print("手机号码有误,请重新输入!!!!")
while qq_istrue:
QQ = str(input("请输入您的QQ号码:"))
ret_qq = re.match(r"\d{6,10}", QQ)
if ret_qq:
qq_istrue = False
else:
print("QQ号码有误,请重新输入!!!!")
while mail_istrue:
mail &#