Jan-21-2019, 09:18 PM
They are making you use indexes when you don't need to. It needlessly complicates your code. The more complicated your code is the harder it is to maintain and debug.
What perfingo says about zip is right. What you want to do should be done this way:
It's like the thing I showed you in the other thread about random.choice. They require you to generate a random index and then access that index. But random.choice does the same thing without that complication.
What perfingo says about zip is right. What you want to do should be done this way:
for item_a, item_b in zip(list_a, list_b): if item_a == item_b: # do whatever.But since they haven't taught you zip yet, you have to do it with indexes, which is more complicated and error prone.
It's like the thing I showed you in the other thread about random.choice. They require you to generate a random index and then access that index. But random.choice does the same thing without that complication.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures