Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions docs/python/python-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,44 @@ print(c) # array('i', [1, 2, 3, 4, 5])

---

### **Practice Questions**

1. **Basic Traversal**

**Q1**: Write a Python program to traverse an array and print each element on a new line.

2. **Maximum Element**

**Q2:** Write a Python program to find the maximum and minimum elements in an array without using built-in functions.

3. **Array Reversal**

**Q3:**** Write a Python program to reverse an array without using slicing or the reverse() method.


4. **Insertion Operation**

**Q4:** Write a Python program to insert an element at a specific index in an array.


5. **Deletion Operation**

**Q5:** Write a Python program to delete an element from a given index in an array.

6. **Search Element**

**Q6:** Write a Python program to search for a given element in an array and print its index if found, otherwise print "Not Found".

7. **Sum of Elements**

**Q7:** Write a Python program to find the sum of all elements in an array without using the sum() function.

8. **Second Largest Element**

**Q8:** Write a Python program to find the second largest element in an array.

---

## Conclusion

Python Arrays are useful when you need to store large amounts of **numeric data** of the same type efficiently.
Expand Down
Loading