Mod2Function and Class Assignment
Mod2Function and Class Assignment
Problem Statement:
You work in XYZ Corporation as a Data Analyst. Your corporation has told you to work on
functions and classes.
Tasks to be performed:
1. Create a function named ‘factor’ that can only accepts 1 argument. The function should
return the factorial of that number.
2. Create a function named ‘check_string’, the function should accept a string data from the
user and the function should check if the user input contains the letter ‘s’ in it. If it contains
the letter ‘s’ then print- ‘The string is containing the letter ‘s’’, if not then print- ‘The string
doesn’t contain the letter ‘s’’.
3. Create a class named ‘student’ and inside the class, create a function named ‘fun1’- this
method should accepts the user defined input and return that value.
a. Create another method named- message() and that method should print the user
defined input that we have defined in ‘fun1’.
4. Create a lambda function that should double or multiply the number (that we will be passing
in the lambda function) by 2. Store the lambda function in a variable named ‘double_num’.
5. Take user input string and check whether that string is palindrome or not.