• API
• FAQ
• Tools
• Archive
SHARE
TWEET Untitled a guest Oct 23rd, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. import random
2.
3. number_source = list(range(1,51))
4.
5. def get_number():
6.     winning_number = []
7.     number_source = list(range(1, 51))
8.     for i in range(5):
9.         number = number_source[random.randint(0,50-(i+1))]
10.         number_source.remove(number)
11.         winning_number.append(number)
12.     winning_number.sort(key=int)
13.     return  winning_number
14.
15. def get_extra():
16.     extra_numbers = []
17.     extra_source = list(range(1, 11))
18.     for i in range(2):
19.         extra_num = extra_source[random.randint(0,10-(i+1))]
20.         extra_source.remove(extra_num)
21.         extra_numbers.append((extra_num))
22.     extra_numbers.sort(key=int)
23.     return  extra_numbers
24.
25. def generate_random_num():
26.     winning_number = []
27.     number_source = list(range(1, 51))
28.     for i in range(5):
29.         number = number_source[random.randint(0, 50 - (i + 1))]
30.         number_source.remove(number)
31.         winning_number.append(number)
32.     winning_number.sort(key=int)
33.     return  winning_number
34.
35. def generate_random_extra():
36.     extra_numbers = []
37.     extra_source = list(range(1, 11))
38.     for i in range(2):
39.         extra_num = extra_source[random.randint(0, 10 - (i + 1))]
40.         extra_source.remove(extra_num)
41.         extra_numbers.append((extra_num))
42.     extra_numbers.sort(key=int)
43.     return extra_numbers
44.
45. Winner = get_number()
46. extra = get_extra()
47. Tries = 0
48. Winnings = 0.0
49. g = 1000000
50.
51. for i in range(g):
52.     generated_number = generate_random_num()
53.     generated_extra = generate_random_extra()
54.     d = set(generated_number) & set(Winner)
55.     e = set(generated_extra) & set(extra)
56.
57.     if len(d) == 5 and len(e) == 2:
58.         print('JACKPOT')
59.     elif len(d) == 2 and len(e) == 1:
60.         Winnings += 9.10
61.     elif len(d) == 1 and len(e) == 2:
62.         Winnings += 10.60
63.     elif len(d) == 3 and len(e) == 0:
64.         Winnings += 17.00
65.     elif len(d) == 3 and len(e) == 1:
66.         Winnings += 22.10
67.     elif len(d) == 2 and len(e) == 2:
68.         Winnings += 23.70
69.     elif len(d) == 3 and len(e) == 2:
70.         Winnings += 70.40
71.     elif len(d) == 4 and len(e) == 0:
72.         Winnings += 133.50
73.     elif len(d) == 4 and len(e) == 1:
74.         Winnings += 356.60
75.     elif len(d) == 4 and len(e) == 2:
76.         Winnings += 6831.80
77.     elif len(d) == 5 and len(e) == 0:
78.         Winnings += 102477.50
79.     elif len(d) == 5 and len(e) == 1:
80.         Winnings += 483921.80
81. Winnings = round(Winnings, 2)
82. print('Winnings: ' + str(Winnings) + '€')
83. ROI = (Winnings / (g * 2)) * 100
84. print('ROI' + str(round(ROI, 1)) + '%')
85. print('Cost' + str(g * 2) + '€')
86.
87. print('Complete')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.

Top