|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
为啥老是SyntaxError: invalid syntax,大佬们帮我看看错在哪里了
dict3 = {'小甲鱼':'帅哥'}
dict4 = {'小甲鱼':123456789}
q = False
w = False
tianjia = int(input('你要添加联系人吗(1=yes,2=no)'))
if tianjia ==1:
q = True
while q:
temp1 = str(input('请输入他的姓名'))
temp2 = str(input('请输入他的身份'))
temp3 = int(input('请输入他的电话'))
dict3[temp1] = temp2
dict4[temp1] = temp3
temp4 = int(input('是否继续添加联系人:(1=yes,2=no)'))
if temp4 ==2:
break
tianjia = int(input('你要删除联系人吗(1=yes,2=no)'))
if tianjia ==1:
w = True
while w:
temp5 = str(input('输入你所想要删除的名字'))
dict3.pop(temp5)
dict3.pop(temp5)
temp6 = int(input('你还要继续删除联系人吗(1=yes,2=no))')
if temp6 == 2:
break
temp = str(input('索要查询的名字'))
print('他的身份是:', dict3[temp])
print('他的电话是:', dict4[temp])
第28行:
- temp6 = int(input('你还要继续删除联系人吗(1=yes,2=no)'))
复制代码
|
|