【发布时间】:2025-12-20 06:15:15
【问题描述】:
suspect = {'Height':6,'Colour':'Fair','Residency':'Pune'}
Name = input('Please enter your name')
Verification = int(input('Please enter Height ')
if Verification == suspect['Height']:
print('Suspect is detected for 1st level')
else:
print('Suspect is not detected for 1st level')**
请注意,我的情况是:如果使用{'Height': 3, 'Colour': 'Fair', 'resident': 'Pune'}-condition 检测到suspect,则应保存名称并继续运行代码。意思是'Please enter your name'和'Please Enter Height'应该继续问。
【问题讨论】:
-
如果没有检测到嫌疑人怎么办?它应该继续运行你的代码吗?
标签: python-3.x dictionary if-statement