Searching for elements in the python list and then accessing specific values
My list = ('A', 3, ['x', 'y', 'z']), ('b', 2, ['m', 'n']]] variable = 'a' i = Indx For example, I want to see if the variable is present and the use of its elements is present, then see each one after one sublist element for example above In the example I would like to check that 'A' fun Get the and if so, 'X', 'Y' and access to personal Uplibb elements such as 'Z'. >
It looks like you have not got a Python Dot yet. Perhaps you mean:
mydict = {} mydict ['A'] = {'count': 3, 'letters': ['x', 'y', 'z']} Mydict ['B'] = {'Count': 2, 'Letters': ['m', 'n']} mydict is a dictionary Counting is a bit of a thing in storage, because you can only use len () if you need it, you can do it like this: <"" "" "" "" '' '' '' '' '' '']} Print minded ['a']
Comments
Post a Comment