Part 1
The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
Include all of the following in your Learning Journal:
The code for your print_volume function.
The inputs and outputs to three calls of your print_volume.
Part 2
Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.
Include all of the following in your Learning Journal:
The code for the function that you invented.
The inputs and outputs to three calls of your invented function.
A description of what feature(s) your function illustrates.
In a class test teacher announces the marks (negative marking is allowed) of n students a student can achieve maximum 100 marks. Write a python function p-marks (*marks) that takes number of students, marks of students and return the marks and check the marks are valid or not. If valid then it calls the recursive function rec-sort(*marks) which returns the students marks as comma separated string with elements in ascending order (you can use built in function max or min to do this). Specify the input in fixed form do not use input function.
1. There are 3 arrangements of the word DAD, namely DAD, ADD, and DDA. How many arrangements are there of the word ENDURINGLY?
2. There are 13 men and 12 women in a ballroom dancing class. If 6 men and 6 women are chosen and paired off, how many pairings are possible?
3. Suppose you are taking a multiple-choice test with 4 choices for each question. In answering a question on this test, the probability that you know the answer is 0.33. If you don’t know the answer, you choose one at random. What is the probability that you knew the answer to a question, given that you answered it correctly?
4. A normal distribution which has a mean of 50 and standard deviation of 7 is taken into consideration.
68% of the distribution can be found between what two numbers?
a) 40 and 60
b) 0 and 43
c) 0 and 68
d) 43 and 57
5. Consider the data X = (58,59,63,60,60,63,60,57,58,59). An unbiased estimation for population variance would be ____
Stock_File_1’, a stock trend forecasting company has just employed you as a Data Scientist. As a first task in your new job, your manager has provided you with a company’s stock data and asked you to check the quality of the data for the next step of analysis. Following are the additional description and information about the data which your manager has shared with you.
a) The data set contains six variables namely-
i. Date
ii. Open
iii. High
iv. Low
v. Close
vi. Volume
Consider a following function f:
def mys(m):
if m==1:
return(1)
else:
return(m+mys(m-1))
Polynomial
Given polynomial, write a program that prints polynomial in Cix^Pi + Ci-1x^Pi-1 + .... + C1x + C0 format.
Given polynomial, write a program that points in Cix^Pi+Ci-1x^Pi-1
def h(n):
s = 0
for i in range(2,n):
if n%i == 0:
s = s+i
return(s)In a class test teacher announces the marks (negative marking allowed) of n students a student can achieve max 100 marks. Write a python function p-marks(*marks) that takes no. of students , marks of students and return the marks and check the marks are valid or
not. If valid then it calls the recursive function re-sort(*marks) which returns the students marks as a comma-separated string with elements in ascending order ( You can use built-in function max() or min() to do this) . Specify input in fixed form.
Janhvi is studying about the python list . She is facing the problem to predict the output
of following python code
1
lst1 = [10, 15, 20, 25, 30]
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-5]