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

Python (PCC-CS393) : IT2 Year, 3 Semester, Year:2020 Assignment-2

1. The document outlines 14 programming assignments for a Python course. The assignments include writing functions to return full names, check even/odd numbers, calculate simple interest, calculate volume of a cuboid, sum a series, add variable arguments, print Fibonacci series, calculate exponents recursively, create and call modules, list module identifiers, print multi-line comments, and perform math operations on numbers. 2. Functions are to be written to check if integers are sorted, and return numbers between two values that are divisible by a given number.

Uploaded by

Avirup Ray
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)
106 views

Python (PCC-CS393) : IT2 Year, 3 Semester, Year:2020 Assignment-2

1. The document outlines 14 programming assignments for a Python course. The assignments include writing functions to return full names, check even/odd numbers, calculate simple interest, calculate volume of a cuboid, sum a series, add variable arguments, print Fibonacci series, calculate exponents recursively, create and call modules, list module identifiers, print multi-line comments, and perform math operations on numbers. 2. Functions are to be written to check if integers are sorted, and return numbers between two values that are divisible by a given number.

Uploaded by

Avirup Ray
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 (PCC-CS393)

IT 2nd Year, 3rd Semester, Year:2020


Assignment-2

1. Write a function that will take the first and last name of a person and returns the full name.

2. Write a function to check whether a given number is even or odd. Display the statement after
returning form the function.

3. Write a function to calculate simple interest. Take input the principle amount, number of years
and whether the customer is senior citizen or not. For senior citizen, the rate of interest is 12 and for
others it is 10. Use keyword arguments.

4. Write a function to calculate the volume of a cuboid using default arguments.

5. Write a function to sum the series 1/1! + 4/2! + 27/3! + ....

6. Write a function to add the values passed to a function using variable-length arguments.

7. Write a recursive function to print Fibonacci series.

8. Write a function to calculate exponent of a number using recursive function.


exp(x,y) = 1 if y = 0
y-1
= x * exp(x ) otherwise

9. Create your own module to calculate sum of two integers. Call this module from main module to
find the sum of two numbers.

10. List all the identifiers defined in a module.

11. Print the multi-line comments mentioned inside a function.

12. Write a function to print absolute value, square roor value, exponential value and cube of a
number.

13. Write a function that accepts three integers and returns True if they are sorted, otherwise it
returns False.

14. Write a function that accepts two positive numbers n and m, where m<=n, and returns numbers
between 1 and n that are divisible by m.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy