Hi, I'm working on this practice task which is like a quiz, When if the after is correct the question repeats all the time and not moving to the next question on the list?? Any inputs? Thanks
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
print ( "USE FUNCTION --> game()" ) def main(): pass qs = [ "Grass" , "Horn" , "Feather" , "Laugh" , "Smooth" , "Mountain" , "Abundance" , "absorb" , "cheapskate" , "citizenship" , "classify" , "kingdom" , "kilometer" , "poet" , "free" ] an = [ "damo" , "sungay" , "balihibo" , "tawa" , "makinis" , "bundok" , "kasaganahan" , "sipsipin" , "barat" , "pagkamamamayan" , "suriin" , "kaharian" , "kilometro" , "makata" , "malaya" ] ##def attempt(): ## count = 0 ## att = input("Ilagay ang iyong sagot: ") ## ## print("Mali ang iyong sagot, Subukan Muli") ## break def game(): print ( "---------------------------------" ) print ( "Welcome to game DAY 2 Quiz - Translate English to Tagalog" ) print ( "---------------------------------\n" ) score = 0 count = 0 #Select I then use range staring from 0 till the end minus while count < 3 : for i in range ( 0 , 3 ): student = input (qs[i] + "\n Ilagay ang iyong sagot: " ).upper() ## while count < 3: if student = = an[i].upper(): print ( "Correct\n" ) score + = 1 else : print ( "\n Wrong! Try Again\n" ) print ( "Attempt" ,count) count + = 1 break print ( "Ang tamang sagot ay" ,an[i]) name = input ( "What is you name: " ).upper() print ( "Hey!" ,name, "Your final score is" ,score, "out of 15\n" ) input ( "Press ENTER to exit" ) |