You are on page 1of 2

WCTB

Assignment-2

Instruction:
• Please go through the PPTs before solving the questions. Some concepts
may not have been discussed in class due to limited time.

1. Write a function Eval_Quadratic_Equa(a, b, c, x) which returns the value of any


quadratic equation of form ax2+bx+c
2. Write a function calc_exp(base, exp) which computes the exponent of any number,
i.e., baseexp. The function should take two values as base, which can be float or
integer. Exp will be an integer greater than 0.
3. Write a function Calc_GCD_Recurr(a, b) which calculates the greater common
divisor(GCD) of two number. The function should take two positive integers and
should return one integer as GCD.
4. Write a function reverse_number() to return the reverse of the number entered.
5. A four-digit integer is entered through the keyword. Write a function to calculate the
sum of the four-digit number.
6. Write a program to define below functions. Perform the following operations on it.
a) Define the function named get_radius() which returns the radius of the circle.
b) Define the function named calc_area() which returns the area of circle.
7. Create below data frame.
FName LName Age
0 Tom Reacher 25
1 Krish Pete 30
2 Nick Wilson 26
3 Juli Williams 22

8. Create below student data frame and do the below exercise.

ID Name Gender Age Family_Income


MBA21001 Rohit Male 24 1,20,000
MBA21002 Meenal Female 25 98,000
MBA21003 Sneha Female 22 1,12,000
MBA21004 Mrigank Male 23 85,000
MBA21005 Naresh Male 25 92,000
MBA21006 Deepika Female 23 10,6000

a) Calculate mean, median, maximum, minimum, and standard deviation of salary.

b) Calculate mean, median, maximum, minimum, and standard deviation of age.

c) Is there any correlation between age and salary?

9. Draw line and bar diagram on below data.


Month Sales (millions $)
January 50
February 30
March 20
April 15
May 17
June 55
July 40
August 25
September 20
October 60
November 35
December 40

10. Draw a pie chart to visualize the placement statistics on below placement data:
Industry Placement
IT 55
Sales and Marketing 88
Finance and Banking 39
Manufacturing 24
Others 63

You might also like