Index list

Print the list made up of 3 elements:
dif → 20, 2,3

if I print only the first element
dif[1]

I have error

Hi,
nothing serious here read

set no order one content

Sincerely
christian.stan

2 Likes

The issue here is that sets are unordered - therefore you can’t index them. You need to convert your set to a list first.

list(dif)[1]

2 Likes

Thanks for the help
I understand

Thanks for the example… it’s good now
I understand

1 Like