2021年3月24日星期三

program a quiz game for two players with multiple choice

I have a code to do, so basically, I have to do a quiz with multiple answers with dictionaries in python I have to use a random number generator and with that number generated chose that question number so if the number generated is a 5 I gotta ask the 5th question then let the user type his answer and check if it's correct then add points, I gotta do the number and question progress 10 times and do not have the same question twice, also it's for 2 users until now this is my code. but I don't know if it's correct

import random    scorep1 = 0    scorep2 = 0    cont = 0    print("Ladies And gentleman!, I Luis Fernando Cabral Tamayo, will be your host for this quiz!")    print("LET US BEGIN!")    dictionary ={        "1":"Who painted the Mona Lisa?",      "2":"Which planet is closest to the sun?",      "3":"Which is the largest animal in the world?",      "4":"How many elements are there in the periodic table?",      "5":"Which is the lightest material in the periodic table?",      "6":"What is the capital of the USA?",      "7":"What is the name of the actual president of México?",      "8":"What is the coldest place in earth",      "9":"At how many degrees celcius does water boil?",      "10":"How much PI is equivalent to?",      "11":"What was the name of the singer in the band Queen?",      "12":"When did the 2nd World War Ended?",      "13":"What is the capital of Japan?",      "14":"What is the largest country in the world?",      "15":"What is the most populated country in the world?",      "16":"What is the largest river in the world?",      "17":"Where did the olympic games first started?",      "18":"Where is the eifel tower?",      "19":"Who discovered America?",      "20":"How many strings does a regular guitar have?",      "21":"What is the most comon name in Mexico?",      "22":"How many senses does a human have?",      "23":"What year did the USA went arrived at the moon?",      "24":"How many years are there in a Century?",      "25":"How many years are there in a Decade?",      "26":"How many years are there in a Lustrum",      "27":"What is the name of the president of the USA?",      "28":"What is the name of the creator of TESLA?",      "29":"How old is John Cena?",      "30":"How many habitants does México Have?",  }      dictionary2 = {        "1": "A) Leonardo Davinci B) Leonardo Dicaprio C) John Cena D) Karlo Leonardo",      "2": "A)Venus B) Mars C)Earth D) Mercury",      "3":" A)Elephant B)Tiger C)Whale D) Dog ",      "4":"A)28 B) 118 C)150 D)115",      "5":"A)Helium B)Copper C)Hidrogen D)Iron ",      "6":"A)Washington DC B)Florida C)California D)Otawwa",      "7":"A)Andres Manuel Lopez Obrador B)Colosio C)Salinas de gortari D)Guadalupe Victoria",      "8":"A)Her hearth B)Canada C)Rusia D)Antartida",      "9":"A)120 B)200 C)100 D)15",      "10":"A)3.14159 B)2.7812 C)2.877 D)5.55",      "11":"A)Robert Plant B) Freddie Mercury C)Dan Reynolds D)Joan Sebastian",      "12":"A)1990 B)1918 C)1945 D)1939",      "13":"A)Tokio B)Beijing C)CDMX D)Timboctú",      "14":"A)Canada B)India C)China D)Russia",      "15":"A)India B)China C)Guanajuato D)Serbia",      "16":"A)Nile B)Amazonas C)Bravo D)Janeiro",      "17":"A)Perú B)Tlahualilo C)Athenas D)Sonora",      "18":"A)Paris B)Venezuela C)France D)Tampico",      "19":"A)Cristobal Colon B)Valentín Elizalde C)Marco Antonio Solis D)Hernan Cortez",      "20":"A)4 B)9 C)5 D)6",      "21":"A)Jorge B)Luis C)Fernando D)Juan",      "22":"A)10 B)26 C)5 D)3",      "23":"A)1980 B)1991 C)1969 D)1890",      "24":"A)52 B)19 C)100 D)20",      "25":"A)10 B)4 C)5 D)9",      "26":"A)1000 B)5 C)18 D)22",      "27":"A)Donald Trump B)Barack Obama C)Joe Biden D)AMLO",      "28":"A)Joe Biden B)Elon Musk C)Joel Martinez D)Mark Zuckerberg",      "29":"A)43 B)22 C)15 D)53",      "30":"A)150k B)122Millions C)15 and a horse D) 99 millions",          }  def randomxd():           num = [random.randrange(1,30) for i in range(1)]         for e in dictionary:            if e == num:                cont = cont + num      print("Cuestion Number one!: ", )    player1 = input("What is your answer Player number one?")    player2 = input("What is your answer Player number two?")    
https://stackoverflow.com/questions/66792818/program-a-quiz-game-for-two-players-with-multiple-choice March 25, 2021 at 11:48AM

没有评论:

发表评论