In Python, a list is a built-in data structure used to store a collection of items in a single variable.
Characteristics
👉 Ordered: Items stay in the specific order they were added.
👉 Mutable: You can add, remove, or change items at any time.
👉 Zero-Indexed: The first item is at index 0, the second at 1, and so on.
👉 Allows Duplicates: You can have multiple items with the exact same value.
#pythonLearning #pythonforAI #pythonforever
Characteristics
👉 Ordered: Items stay in the specific order they were added.
👉 Mutable: You can add, remove, or change items at any time.
👉 Zero-Indexed: The first item is at index 0, the second at 1, and so on.
👉 Allows Duplicates: You can have multiple items with the exact same value.
#pythonLearning #pythonforAI #pythonforever
👍1🔥1💯1
Python ✨
In Python, a for loop is used to iterate over a sequence (such as a list, tuple, string, or dictionary) or other iterable objects.
👉 Functions
💠 range(): Generates a sequence of numbers (e.g., range(5) produces 0 to 4). It is the standard way to repeat a block of code a specific number of times.
💠enumerate(): Provides both the index and the value of items during iteration.
👉 Control Statements
✅ break: Exits the loop entirely before it has finished iterating.
✅ continue: Skips the current iteration and moves immediately to the next item.
✅ pass: Acts as a placeholder for future code; it does nothing when executed.
#pythonLearning #forLoop #pythonForDataScience
In Python, a for loop is used to iterate over a sequence (such as a list, tuple, string, or dictionary) or other iterable objects.
👉 Functions
💠 range(): Generates a sequence of numbers (e.g., range(5) produces 0 to 4). It is the standard way to repeat a block of code a specific number of times.
💠enumerate(): Provides both the index and the value of items during iteration.
👉 Control Statements
✅ break: Exits the loop entirely before it has finished iterating.
✅ continue: Skips the current iteration and moves immediately to the next item.
✅ pass: Acts as a placeholder for future code; it does nothing when executed.
#pythonLearning #forLoop #pythonForDataScience
👍1💯1