We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 161e5f6 commit a9c800cCopy full SHA for a9c800c
ThreeMonteCup.py
@@ -0,0 +1,27 @@
1
+def shuffle_list(mylist):
2
+ from random import shuffle
3
+ shuffle(mylist)
4
+ return mylist
5
+
6
+def player_guess():
7
+ guess=''
8
+ while guess not in ['0','1','2']:
9
+ guess= input('Pick a number between 0, 1 or 2')
10
+ return int(guess)
11
12
+def check_guess(mylist, guess):
13
+ if mylist[guess] == 'o':
14
+ print('Correct guess')
15
+ else:
16
+ print('Wrong guess, sorry!')
17
+ print(mylist)
18
19
+#INITIAL LIST
20
+mylist= ['', 'o', '']
21
22
+#SHUFFLED LIST
23
+mylist_mixed= shuffle_list(mylist)
24
+#USER GUESS
25
+guess= player_guess()
26
+#FINAL CHECK
27
+check_guess(mylist_mixed, guess)
0 commit comments