|
|
发表于 2017-9-3 14:18:16
|
显示全部楼层
- import random
- score = 0
- count = 0
- list_index = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]
- list_1 = ["NewZealand","love","walk","meeting","food","hello","activity","shark","stomach","canoe","family","reputation","mirror","boy","girl","sun","wind","water","thunder","fire"]
- list_2 = ["Aotearoa","aroha","hikoi","hui","kai","Kiaora","mahi","mako","puku","waka","whanau","mana","karahe","tamaititane","kotiro","komaru","touarangi","katao","wahitiri","kanaku"]
- i=5
- while i:
- i=i-1
- index_1 = random.choice(list_index)
- index_2 = random.choice(list_index)
- if index_1 == index_2:
- print("How to say the English word in Maori language below ?")
- print(list_1[index_1])
- enter = str(input("Please enter the answer:"))
- if enter in list_2:
- print("Correct, you get one mark!")
- score = score + 1
- else:print("Sorry, you are wrong.Answer is",list_2[index_2])
- print("Game over, your total score is %d."%(score))
复制代码 |
|