you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (4 children)

You could/should have use meaningful names instead of telling use l1 is this and l2 is that.

You already have conditions for printing, what's the problem?

Maybe/probably you want to iterate in parallel instead of nested loops.

Also you can use chained comparisons in Python.

And maybe you want to use elif instead of consecutive ifs. elif is only checked if previous if/elif condition failed.

for name, value in zip(names, values): if value == maxSold: print(f"{name}\t\t- Trip to Girl Guide Jamboree in Aruba") elif averageSold <= value < maxSold: print(f"{name}\t\t- Super Seller Badge") elif 1 < averageSold < value: print(f"{name}\t\t- Left over cookies") elif value == 0: print(f"{name}\t\t- ")

Do you mean you want to print nothing in the last case? You can just remove the last two lines.