Help using python in Jupyter Notebook

So I’ve recently started trying using my python skills in jupyter notebook. I’ve run into some questions.
I tried creating lists of lists using an variable attached to an open list and then using a for loop to iterate through a list and .appending it to those open lists. However, every time I run my code through jupyter notebook it will not create new lists for me. see code attached for details.

list2 = [['Fred, 10in, male', 'Donna, 40in, female']]

test_list = []
for ele in list2:
        test_list.append(ele)
print(test_list)

and when i run the code in the jupyter notebook terminal it just spits back this:

[‘Fred, 10in, male’, ‘Donna, 40in, female’]

This code should result in [['Fred, 10in, male', 'Donna, 40in, female']] printed out to the console.

If this is not what you get then please post a screenshot of the jupyer notebook with the visible output.

If this is the output you got, but you wanted to accomplish something else - please provide description of what the expected result is.

2 Likes