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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started