我的代码
import time
print("First we need to know you.")
print("Enter your name please.")
time.sleep(2)
name = input("Name: ")
print("Welcome, " + name + "!")
time.sleep(3)
criminal = input("Are you a criminal?: ")
if criminal=='Y':
就在这里,它突出显示为红色
print('Oh no')
elif criminal=='N':
print('Thank god!')
答案 0 :(得分:3)
您需要在if
和elif
:
if criminal=='Y':
print('Oh no')
elif criminal=='N':
print('Thank god!')
另外,请勿在{{1}}:
之后缩进import
答案 1 :(得分:1)
您必须缩进print('Oh no')
:
if criminal=='Y':
print('Oh no')
elif criminal=='N':
print('Thank god!')