Skip to content
Advertisement

Tag: nested-loops

Looping through multiple columns in a table in Python

I’m trying to loop through a table that contains covid-19 data. My table has 4 columns: month, day, location, and cases. The values of each column in the table is stored in its own list, so each list has the same length. (Ie. there is a month list, day list, location list, and cases list). There are 12 months, with

Creating a table with nested loops in python

I’m learning abort nested loops and I’ve gotten an assignment to create a function that takes two integer inputs. Then it should create something like in this image. Only problem is that when I use an odd number for columns it doesnt work. It has to be an “advanced nested loop” for the assignment to be approved. createTable(1, 2) Answer

Advertisement