-3
That’s not a problem, it’s a question, so I hope you can help me.
I’m a beginner in python, and I’m learning about lists, and the teacher talks about unique, timeless elements.
I wanted to know the difference between them. I did a test, but it was on cmd.
lista1 = list(range(11))
lista1.append(14)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14]
lista1.append([14])
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, [14]]
lista1.extend(55)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'int' object is not iterable
lista1.extend([55])
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 14, [15], 13]
Below is the image.
In the example is 55 or 13?
– Augusto Vasques