How do I know if a list item is another list?

Asked

Viewed 15 times

0

I’m wondering if it’s possible to check if an element of a list is another list, for example:

lista = [0, [1, 2], 3]

If possible, how do I go through this sub-list? for example, if I do:

for elemento in lista:
    print(elemento)

will show the following:

0

[1, 2]

3

I want you to show it:

0

1

2

3

who can help me I thank.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.