0% found this document useful (0 votes)
6 views1 page

Python While Loop Exercises for Lists

The document contains a series of Python programming exercises focused on using while loops with list data types. Each question challenges the reader to perform various operations such as printing elements, finding sums, counting odd numbers, and manipulating lists. The tasks are designed to enhance understanding of while loops and list operations in Python.

Uploaded by

mohanp0210
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Python While Loop Exercises for Lists

The document contains a series of Python programming exercises focused on using while loops with list data types. Each question challenges the reader to perform various operations such as printing elements, finding sums, counting odd numbers, and manipulating lists. The tasks are designed to enhance understanding of while loops and list operations in Python.

Uploaded by

mohanp0210
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python While Loop Questions (List Data Type)

1. Print all elements of a list using a while loop.

2. Print only even numbers from a list using a while loop.

3. Print list elements in reverse using a while loop.

4. Find the sum of all elements in a list using a while loop.

5. Count how many odd numbers are in the list using while.

6. Find the maximum element in a list using a while loop.

7. Create a new list with squares of elements using while.

8. Remove all duplicates from a list using a while loop.

9. Copy all positive numbers to a new list using a while loop.

10. Find the index of a given element using a while loop.

11. Count how many times a specific element appears in the list.

12. Replace all negative numbers in a list with zero using a while loop.

13. Separate even and odd numbers into two new lists using while.

14. Shift all elements one position to the right using a while loop.

15. Merge two lists manually using a while loop.

16. Print every second element of the list using while.

17. Insert a specific value after each even number using while.

18. Delete all elements one by one from the list using a while loop.

19. Swap the first and last element of the list using a while loop.

20. Create a list without using list comprehension or for loop, only while.

You might also like