Python Functions Exercises

1. Maximum of Three Numbers

Write a Python function to find the maximum of three numbers.

2. Sum All Numbers in a List

Write a Python function to sum all the numbers in a list.

3. Multiply All Numbers in a List

Write a Python function to multiply all the numbers in a list.

4. Reverse a String

Write a Python program to reverse a string.

5. Factorial of a Number

Write a Python function to calculate the factorial of a number (a non-negative integer). The function accepts the number as an argument.

6. Check if a Number Falls Within a Given Range

Write a Python function to check whether a number falls within a given range.

7. Count Uppercase and Lowercase Letters in a String

Write a Python function that accepts a string and counts the number of upper and lower case letters.

8. Return a New List with Distinct Elements from a List

Write a Python function that takes a list and returns a new list with distinct elements from the first list.

9. Check Whether a Number is Prime

Write a Python function that takes a number as a parameter and checks whether the number is prime or not.

10. Print Even Numbers from a Given List

Write a Python program to print the even numbers from a given list.

11. Etgar Check if a Number is Perfect

Write a Python function to check whether a number is “Perfect” or not.

12. Check if a String is a Palindrome

Write a Python function that checks whether a passed string is a palindrome or not.

13. Check if a String is a Pangram

Write a Python function to check whether a string is a pangram or not.