-3
任何人都可以帮助我,我已经发布了我的整个工作任何人都可以告诉我如何洗牌这五个问题,请让我非常感谢。如何在python中洗牌问题
print("welcome to the quiz")
Validation = False
while Validation ==False:
name=input("Please enter your name")
age=int(input("Please enter your age"))
print("Use keboard to play the quiz")
play=input("Are you ready for the online safety questions")
if play.capitalize()== "Yes":
if age >16:
print("This quiz might be easier for you")
print("welcome to the quiz")
Validation = False)
question1=input("Q1:What is CEOP?/A:Child Exploitation and Online Protection/B:Child Exploitation and Organised Protectors/C:Criminal Exploration and Online Protection")
score = 0
if question1.capitalize() == "A":
print("WELL DONE")
score = score + 5
elif question1.capitalize() =="B":
print("Wrong Answer")
elif question1.capitalize() =="C":
print("Wrong Answer")
else:
print("Wrong Answer")
print("so far, you have",score,"marks")
question2=input("Q2:When you get an email from someone you do not know, what should you do?/A:Reply and say hello/B:Delete it and mark as spam/C:Forward to your friends")
if question2.capitalize() == "B":
print("WELL DONE")
score = score + 10
elif question2.capitalize() =="A":
print("Wrong Answer")
elif question2.capitalize() =="C":
print("Wrong Answer")
else:
print("Wrong Answer")
print("so far, you have",score,"marks")
question3=input("Q3:How secret should you keep your passwords?/A:Give them to strangers/B:Give them only to your best friends/C:Never give out passwords except to your parents")
if question3.capitalize() == "C":
print("WELL DONE")
score = score + 15
elif question3.capitalize() =="B":
print("Wrong Answer")
elif question3.capitalize() =="A":
print("Wrong Answer")
else:
print("Wrong Answer")
print("so far, you have",score,"marks")
question4=input("Q4:When an online contact who frightens you asks to meet you in person what should you do?/A:Arrange to meet them with your best friend/B:Arrange to meet them/C:Report to CEOP")
if question4.capitalize() == "C":
print("WELL DONE")
score = score + 20
elif question4.capitalize() =="B":
print("Wrong Answer")
elif question4.capitalize() =="A":
print("Wrong Answer")
else:
print("Wrong Answer")
print("so far, you have",score,"marks")
question5=input("Q5:If an email asks you to enter your bank account details because of a problem with your account what should you do?/A:Reply to the email/B:Contact the bank to check if they sent the email/C:Enter your bank account details")
if question5.capitalize() == "B":
print("WELL DONE")
score = score + 25
elif question5.capitalize() =="C":
print("Wrong Answer")
elif question5.capitalize() =="A":
print("Wrong Answer")
else:
print("Wrong Answer")
print ("Thank you for doing the quiz", name,".You scored", score, "marks in the quiz")
Validator=True
else:
Validation=False
你可以给我一个例子吗? –
@HurAli:编辑 –
仍然困惑,因为我们粗略的工作,我们需要使用while循环或函数来做到这一点,也需要使用验证。 –