Parenthesis and brackets in a list Question

Hi, beginner here.

My question is, what is the difference when you have a list and all items are in parenthesis, like this:

[(2, ‘pepperoni’), (6, ‘pineapple’), (1, ‘cheese’), (3, ‘sausage’), (2, ‘olives’), (7, ‘anchovies’), (2, ‘mushrooms’)]

But then you add another set of elements, and the new elements are inside brackets not parenthesis? Like this:

[(1, ‘cheese’), (2, ‘mushrooms’), (2, ‘olives’), (2, ‘pepperoni’), [2.5, ‘peppers’], (3, ‘sausage’), (6, ‘pineapple’)]

Does this affect what I can do when working with the list?

It could affect what you can do with the list. Lists in python don’t enforce types, which is sometimes nice, but the downside is that often it helps being sure about what types you have.
Tuples in python are immutable, which is sometimes exactly what you want out of your data structure.

This could be useful when you want to ensure that a certain elements values will not change whatsoever during the program.

If you are trying to retrieve the data, something like

first = [(2, 'pepperoni'), (6, 'pineapple'), (1, 'cheese'), (3, 'sausage'), (2, 'olives'), (7, 'anchovies'), (2, 'mushrooms')]
print(first[0][1])          #'pepperoni'

it doesn’t matter which one to use.

But if you want to modify an element,

first = [(2, ‘pepperoni’), (6, ‘pineapple’), (1, ‘cheese’), (3, ‘sausage’), (2, ‘olives’), (7, ‘anchovies’), (2, ‘mushrooms’)]
first[0][1]='garlic'           #TypeError: 'tuple' object does not support item assignment

happy coding!