Question: Instructions Perform the tasks and answer the questions using Python code (Jupyter Notebook). Take screenshots of your work and paste them Task 1 Calculate the

Instructions

Perform the tasks and answer the questions using Python code (Jupyter Notebook). Take screenshots of your work and paste them

Task 1

Calculate the area of a circle for the different values of radius given below:

14,35,49,70,84,105

Approach:

a. Create a list of the radius values given.

b. Use the pi function available in the math library.

c. Define a function to calculate the area. Round off the value to 2 decimal places.

d. Create a new list that holds the area of the circle (use the for loop for this).

Task 2

Find the number of elements in the strings that are in upper case in each series. Display the number of elements in each series.

Approach:

a. Define each input as a list.

b. Define a function to get both the outputs.

i) c, E, g, h, I, J

ii) and, BUT, IF, for

iii) RED, Green, blue, WHITE, Black, PINK, Purple, yellow

Task 3

Ani's marks in the first semester across different subjects were the following:

English 76, Mathematics 85, Science 82, Social Science 84, Computer Applications 90

Her marks in the second semester were the following:

English 74, Mathematics 87, Science 84, Social Science 70, Computer Applications 92

Write a function that will accept the score input as a dictionary object. Find and return subjects with minimum and maximum score and return the overall percentage.

Task 4

Create a nested function as per the instructions given below:

The outer function has to calculate the perimeter of a rectangle which is given by 2*(length+breadth).

The inner function should calculate the sum (length+breadth) and return it to the outer function to complete the calculation.

Using the function above, calculate the perimeter of the two rectangles below:

i) length = 100m, breadth = 300m

ii) length = 250m, breadth = 500m

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!