FUNCTIONS
1. Write a Python function to multiply all the numbers in a [Link] List : (8, 2, 3, -1, 7)
Expected Output : -336
2. Write a Python program to reverse a string. Sample String : "1234abcd" Expected Output :
"dcba4321"
3. Write a Python function to calculate the factorial of a number (a non-negative integer).
The function accepts the number as an argument.
4. Write a Python function to check whether a number is in a given range.
5 Write a Python function that accepts a string and calculate the number of upper case
letters and lower case letters. Sample String : 'The quick Brow Fox' Expected Output : No. of
Upper case characters : 3 No. of Lower case Characters : 12
6. Write a Python function that takes a list and returns a new list with unique elements of the
first list. Sample List : [1,2,3,3,3,3,4,5] Unique List : [1, 2, 3, 4, 5]
7. Write a Python function that takes a number as a parameter and check the number is prime
or not.
8. Write a Python function that checks whether a passed string is palindrome or not. Note: A
palindrome is a word, phrase, or sequence that reads the same backward as forward, e.g.,
madam or nurses run.
10. Explain the difference between formal and actual parameters
Formal Parameters
These are the variables defined in a function’s definition (header).
They act as placeholders for the values the function will receive when called.
Actual Parameters (Arguments)
These are the real values (or variables) passed to the function when it is called.
They replace the formal parameters during execution.
11. Write a function to calculate the sum of the digits of a number passed as a parameter.