Functions CBSE Class12 Questions
Functions CBSE Class12 Questions
1. Write a Python function `add_two_numbers` that takes two numbers as arguments and returns
their sum.
2. Create a function `is_even` that checks whether a given number is even or not. It should return
3. Write a function `greet_user` that accepts a name as input and prints a greeting in the format:
"Hello, [Name]!".
4. Write a Python function `find_square` to calculate and return the square of a number.
5. Create a function `is_prime` to check if a given number is a prime number. Return `True` if the
6. Develop a function `simple_interest` to calculate simple interest. The function should take
Formula: SI = (P * R * T) / 100
9. Develop a recursive function `sum_of_digits` to calculate the sum of the digits of a number.
10. Create a recursive function `fibonacci` to return the nth Fibonacci number.
11. Write a Python function `count_vowels` to count the number of vowels in a given string.
12. Create a function `reverse_string` that takes a string and returns the reversed version of the
string.
13. Write a function `is_palindrome` to check if a string is a palindrome (reads the same forwards
and backwards).
14. Create a function `apply_operation` that accepts two numbers and a function as input. The
15. Write a function `find_largest` that accepts three numbers as arguments and returns the largest
number.