Python 如果用户在我的if语句后回答“否”,我如何使代码再次询问您的姓名?

Python 如果用户在我的if语句后回答“否”,我如何使代码再次询问您的姓名?,python,Python,这是我的密码: fullName = input("Hello there, what is your name?") fName = (fullName[0:fullName.index(" ")]) sName = (fullName[fullName.index(" ")+1:]) print("So, your first name is", fName) print("and your se

这是我的密码:

fullName = input("Hello there, what is your name?")

fName = (fullName[0:fullName.index(" ")])

sName = (fullName[fullName.index(" ")+1:])

print("So, your first name is", fName)
print("and your second name is", sName)
answer = input("Is this correct")
就我所知,我的大部分问题都在这里,在这之前的一切都很好:

if answer == "Yes" or answer == "yes":
    print("Great, lets get started!")
elif answer == "No" or answer == "no":

简单快速的回答,也许有更简单的方法

fullName=input(“你好,你叫什么名字?”)
fName,sName=fullName.split()
打印(“那么,你的名字是”,fName)
打印(“您的第二个名字是”,sName)
回答=输入(“这正确吗?”)
而不是(回答==“是”或回答==“是”):
fullName=input(“你好,你叫什么名字?”)
fName,sName=fullName.split()
打印(“那么,你的名字是”,fName)
打印(“您的第二个名字是”,sName)
回答=输入(“这正确吗?”)

发帖前你读过吗?@jornsharpe,伙计,我是新来的,我一周前才开始编写代码,我想我现在格式化的更好了。还有,你知道在这里该做什么吗?这能回答你的问题吗?谢谢,代码成功了,现在我可以继续了。