We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 18aff1d commit 50a16a6Copy full SHA for 50a16a6
CH04/EX4.15.py
@@ -29,11 +29,15 @@
29
30
if num == guess:
31
print("Exact match. You won $10,000")
32
-elif (g1 == n1 or g1 == n2 or g1 == n3) and (g2 == n1 or g2 == n2 or g2 == n3) and (g3 == n1 or g3 == n2 or g3 == n3):
+elif ( g1 == n1 and g3 == n2 and g2 == n3 or
33
+ g2 == n1 and g1 == n2 and g3 == n3 or
34
+ g2 == n1 and g3 == n2 and g1 == n3 or
35
+ g3 == n1 and g1 == n2 and g2 == n3 or
36
+ g3 == n1 and g2 == n2 and g1 == n3):
37
print("Match all digits: you win $3,000")
38
elif (g1 == n2 or g1 == n3
39
or g2 == n1 or g2 == n3
40
or g3 == n1 or g3 == n2):
41
print("Match one digit: you win $1,000")
42
else:
- print("Sorry, no match")
43
+ print("Sorry, no match")
0 commit comments