如果他们能够一次回答一个问题,如何给 5 分,但如果他们在第二次回答时使用

print("Artist quiz")

question1 = "Who sang Perfect?"

options1 = "a.Myslef\nb. Papa\nc. Johhny\nd. Ed Sheeran\n"

print(question1)

print(options1)


while True:

    response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")    


if response == "d":

    break

else:

    print("Incorrect!!! Try again.")

    while True:

        response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")


        if response == "d":

            stop = True

            break

        else:

            print("Incorrect!!! You ran out of your attempts")

            stop = True

            break

    if stop:

        break


question2 = "Who sang Umbrella?"

options2 = "a.Okie dokie\nb. Rhianna\nc. Shakira\nd. Beyonce\n"

print(question2)

print(options2)


while True:

    response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")


if response == "b":

    break

else:

    print("Incorrect!!! Try again.")


    while True:

        response = input("Hit 'a', 'b', 'c' or 'd' for your answer\n")


        if response == "b":

            stop = True

            break

        else:print("Artist quiz")

这是我到目前为止所拥有的,但我想添加一个评分系统,一次尝试回答它是 5 分,但两次尝试回答它只有 3 分。任何帮助,将不胜感激。我仍然需要它来解决这两个问题。


FFIVE
浏览 139回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python