Saltar al contenido

Ejemplo de código de preguntas del cuestionario de programación de Python

Este equipo de redactores ha pasado mucho tiempo investigando respuestas a tu pregunta, te dejamos la respuesta por esto deseamos servirte de mucha ayuda.

Ejemplo: prueba de Python

score =0
score =int(score)#Ask user for their name
name =input("What is your name?")
name = name.title()print("""Hello , welcome to Quiz night! 
You will be presented with 5 questions.
Enter the appropriate number to answer the question
Good luck!""".format(name))#Question1print("""Question here
1.  
2.  
3.  
4. """)

answer1 ="correct number here"
response1 =input("Your answer is: ")if(response1 != answer1):print("Sorry, that is incorrect!")else:print("Well done! "+ response1 +" is correct!")
    score = score +1print("Your current score is "+str(score)+" out of 5")#Question2print("""What is the name of the town your character lives in before The Great War?
1. Diamond City 
2. Sanctuary Hills 
3. Concord 
4. The Glowing Sea""")

answer2 ="correct number here"
response2 =input("Your answer is:")if(response2 != answer2):print("Sorry, that is incorrect!")else:print("Well done! "+ response2 +" is correct!")
    score = score +1print("Your current score is "+str(score)+" out of 5")#Question3print("""Question here
1.  
2.  
3.  
4. """)

answer3 ="correct number here"
response3 =input("Your answer is:")if(response3 != answer3):print("Sorry, that is incorrect!")else:print("Well done! "+ response3 +" is correct!")
    score = score +1print("Your current score is "+str(score)+" out of 5")#Question4print("""Question here
1. 
2. 
3. 
4. """)

answer4 ="correct number here"
response4 =input("Your answer is:")if(response4 != answer4):print("Sorry, that is incorrect!")else:print("Well done! "+ response4 +" is correct!")
    score = score +1print("Your current score is "+str(score)+" out of 5")#Question5print("""Question here
1. False
2. True""")

answer5 ="correct number here"
response5 =input("Your answer is:")if(response5 != answer5):print("Sorry, that is incorrect!")else:print("Well done! "+ response5 +" is correct!")
    score = score +1print("Your total score is "+str(score)+" out of 5")print("Thank you for playing , goodbye!".format(name))

Comentarios y valoraciones del tutorial

Te invitamos a respaldar nuestra labor ejecutando un comentario o valorándolo te damos la bienvenida.

¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)



Utiliza Nuestro Buscador

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *