Learning Tuples in Python Day 4

Day 4 of learning Python Today I learned about TUPLES: Used to store multiple items in one variable Ordered & allow duplicate values Immutable (cannot change, add, or remove items) Key Concepts: Access items using indexing (positive & negative) Find length using len() Check item using "in" keyword Loop through tuple using for loop Important: To create a single item tuple → use comma Example: ("apple",) Workaround for updating tuple: Tuple → List → Modify → Convert back to Tuple Adding items: Tuples don’t support append(), but we can: Convert to list OR Add another tuple Practiced: Indexing Looping Checking elements Updating using workaround #Python #CodingJourney #100DaysOfCode #WomenInTech #LearnToCode

RAHEELA TABASSUM Good to see this. Concepts like tuples seem simple, but they’re really important when working with data structures. Consistency like this makes a big difference!

See more comments

To view or add a comment, sign in

Explore content categories