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

Python Coding Exercises Collection

The document is a collection of Python exercises designed to enhance programming skills. It includes tasks such as calculating the area of a rectangle, swapping variables, checking number properties, and manipulating strings and lists. Additional exercises involve file handling, mathematical functions, and character frequency analysis.

Uploaded by

dontercet
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 Coding Exercises Collection

The document is a collection of Python exercises designed to enhance programming skills. It includes tasks such as calculating the area of a rectangle, swapping variables, checking number properties, and manipulating strings and lists. Additional exercises involve file handling, mathematical functions, and character frequency analysis.

Uploaded by

dontercet
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 Exercises Collection

1. Rectangle Area Calculator: Compute area from width and height.


2. Swap Two Variables without using a third variable.
3. Check if a number is positive, negative, or zero.
4. Count words in a sentence.
5. Sum only even numbers in a list.
6. Remove duplicates from a list without using set().
7. Reverse a string using a loop.
8. Generate a list of squares up to n.
9. Count character frequency in a string.
10. Matrix addition (2x2 or 3x3).
11. Read a text file and count lines, words, and characters.
12. Write a function that returns the maximum of three numbers.
13. Create a function that checks if a number is prime.
14. Write a function that returns the factorial of a number.
15. Create a function that counts vowels in a string.
16. Write a function that takes a list and returns only the unique elements.

You might also like