-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseball.py
More file actions
56 lines (54 loc) · 1.76 KB
/
baseball.py
File metadata and controls
56 lines (54 loc) · 1.76 KB
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
from standings import Standings, StandingsCheck
from stats import Statistics, StatisticsCheck
from roster import Roster, RosterCheck
from scores import Scores, ScoresCheck
from schedule import Schedule, ScheduleCheck
def Help():
print()
print("This program can output data from the current MLB season:")
print(" -- leaguewide 'scores' for a given day.")
print(" -- division or wild card 'standings'.")
print(" -- player 'statistics' for hitting, pitching, and fielding.")
print(" -- team 'roster' or 'schedule'.")
print()
if __name__ == "__main__":
print("Welcome to the Michael's Baseball Program.")
while True:
arg = input().split()
# Quit program
if arg[0] == 'exit' or arg[0] == 'quit':
break
# Help message
if arg[0] == 'help':
Help()
# Standings
if 'standings' in arg:
arg.remove('standings')
i, s = StandingsCheck(arg)
if i == 0:
Standings(s)
# Statistics
if ('statistics' in arg) or ('stats' in arg):
arg = [x for x in arg if x not in ['statistics','stats']]
i, s = StatisticsCheck(arg)
if i == 0:
Statistics(s)
# Roster
if 'roster' in arg:
arg.remove('roster')
i, s = RosterCheck(arg)
if i == 0:
Roster(s)
# Scores
if 'scores' in arg:
arg.remove('scores')
i, s = ScoresCheck(arg)
if i == 0:
Scores(s)
# Schedule
if 'schedule' in arg:
arg.remove('schedule')
i, s = ScheduleCheck(arg)
if i == 0:
Schedule(s)
continue