
# Empty list
my_list = []
# List of numbers
numbers = [1, 2, 3, 4, 5]
# List of strings
fruits = ["apple", "banana", "cherry"]
# Mixed data types
mixed = [10, "hello", 3.14, True]
👉 Output:
['apple', 'banana', 'cherry']
fruits = ["apple", "banana", "cherry"]
print(fruits[0]) # First item → apple
print(fruits[1]) # Second item → banana
print(fruits[-1]) # Last item → cherry
👉 Output:
apple
banana
cherry
list[start:end]
start → index where slice begins (inclusive).end → index where slice stops (exclusive).numbers = [10, 20, 30, 40, 50]
print(numbers[1:4]) # from index 1 to 3 → [20, 30, 40]
print(numbers[:3]) # from start to index 2 → [10, 20, 30]
print(numbers[2:]) # from index 2 to end → [30, 40, 50]
print(numbers[-3:]) # last 3 items → [30, 40, 50]
👉 Output:
[20, 30, 40]
[10, 20, 30]
[30, 40, 50]
[30, 40, 50]
Fill out the Get Help form and our team will contact you.
We accept UPI, Debit/Credit Cards, and Net Banking.
Yes, installment options are available for selected courses.
Yes, we provide resume and interview support.