How are array types (lists and tuples) and for loops related in Python? -


how array types (lists , tuples) , loops related in python? little bit confused. english new.

lists:

  • they mutable; is, elements inside of permitted change.
  • they use bracket notation [].

tuples:

  • they immutable; is, elements comprised of not permitted change.
  • they use parentheses notation ().
  • perform little faster due immutability.

both lists , tuples:

  • can iterated on (for x in elements)
  • can sliced (elements[1:3])
  • can indexed (elements[0])

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -