What is the purpose of having two brackets around a list? For example List = [[a, b, c]]
Let me give you some examples. lst = [1, 2, 3] list = [[1, 2, 3]] lst has three elements, but list has 1. lst.append(list) now, lst = [1, 2, 3, [1,2,3]] so, it has 4 elements now. Hope it helped
Your example is a list within a list = a nested list: The inner list contains a, b, c while the outer list contains the inner list. [[a, b], c] In thos example, the outer list contains a list (containing a and b) and c
points=[[3,7],[2,3],[4,8]] could be a list of points with x and y coordinates.
wow. this community is awesome. thanks everyone.
I have made a calculator in which my % (Percentage) not work correctly for 100%50 or 100%20.
Python palindrome challenge.
Number of Ones ( C++ ) question!