I have a program that I'm writing for a computer class, and I'm having a little bit of trouble accessing the index value of something. I'm fairly new to python (I have only been using it for a week) and I need this program to work successfully. I've already tried other posts and have used content from other posts, but I'm still struggling with trying to make my program work. I hope this is enough to work with.
I want to print the corresponding index to each item in the "tasks" list at the bottom "wModt" spot. I've tried asking one of the instructors but I was still confused. I want the tasks to be chosen in the index order 0, 1, 2, etc. and then repeat. Please help!
Here is some of my code.
workers = ['Jim','Bob','Matt','Brian','Evan','Alan','Gary','Henry','Noah']
tasks = ['Drilling','Digging','Filling','Pouring']
...
while len(workers) > 0:
wModt = num_workers % num_tasks
working = random.choice(workers)
workers.remove(working)
num_workers -= 1
for idx, val in enumerate(tasks):
pass
print working + "'s job is", wModt