Python Revision Notes

 

9. List & Tuple

  • List: Mutable, ordered

lst = [1,2,3] lst.append(4)
  • Tuple: Immutable, ordered

tup = (1,2,3)

10. Dictionary & Set

# Dictionary d = {"name":"Ajm", "age":18} print(d["name"]) # Set s = {1,2,3,3} print(s) # {1,2,3}

Comments

Popular posts from this blog

Python Revision Notes

Python Revision Notes

Python Revision Notes