MCPcopy Index your code
hub / github.com/kyclark/tiny_python_projects / main

Function main

19_wod/solution2.py:56–77  ·  view source on GitHub ↗

Make a jazz noise here

()

Source from the content-addressed store, hash-verified

54
55# --------------------------------------------------
56def main():
57 """Make a jazz noise here"""
58
59 args = get_args()
60 random.seed(args.seed)
61 exercises = read_csv(args.file)
62
63 if not exercises:
64 sys.exit(f'No usable data in --file "{args.file.name}"')
65
66 num_exercises = len(exercises)
67 if args.num > num_exercises:
68 sys.exit(f'--num "{args.num}" > exercises "{num_exercises}"')
69
70 wod = []
71 for name, low, high in random.sample(exercises, k=args.num):
72 reps = random.randint(low, high)
73 if args.easy:
74 reps = int(reps / 2)
75 wod.append((name, reps))
76
77 print(tabulate(wod, headers=('Exercise', 'Reps')))
78
79
80# --------------------------------------------------

Callers 1

solution2.pyFile · 0.70

Calls 2

get_argsFunction · 0.70
read_csvFunction · 0.70

Tested by

no test coverage detected