0% found this document useful (0 votes)
21 views

Mod2Function and Class Assignment

This document outlines tasks for a Python data science certification course module on functions and classes. The tasks include: 1) Creating a factorial function, 2) Creating a function to check if a string contains a letter, 3) Creating a student class with methods, 4) Creating a lambda function to double a number, and 5) Checking if a string is a palindrome. The document provides details on the expected behavior and parameters for each task.

Uploaded by

V P
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)
21 views

Mod2Function and Class Assignment

This document outlines tasks for a Python data science certification course module on functions and classes. The tasks include: 1) Creating a factorial function, 2) Creating a function to check if a string contains a letter, 3) Creating a student class with methods, 4) Creating a lambda function to double a number, and 5) Checking if a string is a palindrome. The document provides details on the expected behavior and parameters for each task.

Uploaded by

V P
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
You are on page 1/ 1

Python for Data Science Certification Course

Module 2: Function 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.

[email protected] - +91-7022374614 - US: 1-800-216-8930 (Toll Free)

You might also like