-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPP_RebAssists.py
61 lines (47 loc) · 1.41 KB
/
PP_RebAssists.py
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Reb+As
import random
points = []
reb = []
ass = []
loop = 'y'
target=1
while True:
target = input('\nWhat is the target number (press n to close) \t')
if target == 'n':
break
target = float(target)
#while len(points)!=5:
# points = [int(x)
# for x in input('write five numbers points \t').split()]
while len(reb)!=5:
reb = [int(x)
for x in input('write five numbers rebounds \t').split()]
while len(ass)!=5:
ass = [int(x)
for x in input('write five numbers assists \t').split()]
over=0
under=0
for x in range(1000):
#score = random.choice(points)+random.choice(reb)+random.choice(ass)
score = random.choice(reb)+random.choice(ass)
if score> target:
over+=1
elif score< target:
under+=1
uratio = under/1000
oratio = over/1000
print(f'He hits the under {uratio} percent of the time \n and the over {oratio} percent of the time')
points = []
reb = []
ass = []
'''
import requests as re
from bs4 import BeautifulSoup
url = ''
r = re.get(url)
busu = BeautifulSoup(r.text,'html.parser')
last5 = busu.find_all('table')[0]
for x in last5.find_all('tr')[1:]:
print(int(x.find_all('td')[17].text)) #Total Rebounds
print(int(x.find_all('td')[18].text)) #Assists
'''