> The ouput for below is 2 when it seems like there should be 3 lists located > inside x. Is it [10,20] that is not consider inside of x? Any tips on how > to tell how to spot them more clearly? > > x = ['a', [2.0, 5, [10, 20]]] > print len(x)
Hey Scott Here, it looks like x is a list containing 'a' and [2.0, 5, [10, 20]], hence why the len(x) gives 2. len(x[1]) gives you 3 ( [2.0, 5, [10, 20]] ) len(x[1][2]) gives you 2 ( [10, 20] ) Matt _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor