I started a beginner’s course on Python yesterday, and I am already finding myself stuck. I’m not fishing for an exact answer, just a bump in the right direction, so rather than the actual code I’m working with, I’m just going to give a basic example. Made 3 basic lists basically being:

People = [p1, p2, p3] variable1 = [v1, v2, v3] variable2 = [n1, n2, n3].

Then I turned those into a more organized nested list, such as:

Nest_list = [[people(0), variable1(0), variable2(0)], [people(1), variable1(1), variable2(1)], [people(2), variable1(2), variable2(2)]]

Then I was given an introduction to for loops. I got the beginning of it just fine. Now I’m supposed to use a for loop to apply the formula of "variable1**2/variable2 = answer" through the entire nested list, and it just stumped me completely. The tutorial showed me how to run a simple formula such as i**2 down a basic list, and how to print certain aspects of a nested list, then left me on my own to figure this out. I’m sure I’m missing something simple. Any help appreciated.

That’s variable1(squared)/variable2, and later i(squared). I guess the forum doesn’t support the Python symbol for exponents.

I can get the formula to run on each group individually, but I can’t get it to run through the entire list. When I try that, I just end up with it running the formula on one group, multiple times. What am I missing here?!?

Can you show your code? It really will be easier to help having that information. Even for a small push to the right direction that information is vital to pinpoint place where things go wrong.

Oh, I suppose I should delete this. I figured it out earlier, I guess I sat on it too long and needed to take a step away for a bit. Basically I was trying to do

for nested in nest_list[0:]:

nest_list(1)/nest_list(2) **2

And what I needed to do was

for nested in nest_list:

nested(1)/nested(2)**2

I think a big part of my confusion was that it had me naming lists so similar to the terms I was using in the code