Median
given a list of integers,write a program to print the mean,median and mode
median - the mid point value in the sorted list.
input
the input will be a single line of containing space-separated integers.
output
the second line of output should contain the median, round off the value to 2 decimal places.
median should be a float value when there are even number of elements, otherwise should be an integer value.
see sample input/output for the output format
explanation
for example, if the given list of integers are
2 6 3 8 12 2 9 10 3 4
the average of all the numbers is 4.67.
after sorting the array,
1 2 2 3 3 4 6 8 9 10 12
as the length of the list is an odd number, the median will be middle numbers in the sorted list.so the median will be 4
so the output should be
Median: 4
Median
given a list of integers,write a program to print the median.
input
the input will be a single line of containing space-separated integers.
output
the second line of output should contain the median, round off the value to 2 decimal places.
median should be a float value when there are even number of elements, otherwise should be an integer value.
see sample input/output for the output format
explanation
for example, if the given list of integers are
2 4 5 6 7 8 2 4 5 2 3 8
the average of all the numbers is 4.67.
after sorting the array,
2 2 2 3 4 4 5 6 7 8 8
as the length of the list is an even number, the median will be the average of the two middle numbers in the sorted list.
the middle numbers will be 5 and 4. so the average of 5 and 4 will be median, which is 4.5
so the output should be
Median: 4.5
sample input 1
2 4 5 6 7 8 2 4 5 2 3 8
sample output 1
Median: 4.5
If df is a DataFrame that includes a column 'x', what is NOT a way to add a new column 'y', using a function 'f' that applies a transformation?
Select an answer:
mean
given a list of integers,write a program to print the mean.
mean - the average value of all the numbers.
input
the input will be a single line containing space-separated by integers.
output
the first line of output should contain the mean, round off the value to 2 decimal places.
mean should always be a float value.
see sample input/output for the output format.
explanation
for example, if the given list of integers are
2 4 5 6 7 8 2 4 5 2 3 8
the average of all the numbers is 4.67.
as the length of the list is an even number,
so the output should be
Mean: 4.67
for example, if the given list of integers are
2 6 3 1 8 12 2 9 10 3 4
the average of all the numbers is 5.45.
as the length of the list is an even number,
so the output should be
Mean: 5.45
sample input 1
2 4 5 6 7 8 2 4 5 2 3 8
sample output 1
mean: 4.67
sample input 2
2 6 3 1 8 12 2 9 10 3 4
sample output 2
mean: 5.45
qusetion: Multiplication of matrix ??
input:
3 3
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
output:-
[84 90 96]
[201 216 231]
[318 342 366]
question: find the perimeter of the given matrix?
input1:-
3 3
1 2 3
4 5 6
7 8 9
output :-
1+2+3+4+6+7+8+9 = 40
input2:-
4 4
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
output:-
1+2+3+4+5+8+9+12+13+14+15+16= 102
mean
given a list of integers,write a program to print the mean
mean - the average value of all the numbers.
input
the input will be a single line of containing space-separated integers.
output
the first line of output should contain the mean, round off the value to 2 decimal places.
mean should always be a float value.
mean should be a float value when there are even number of elements, otherwise should be an integer value.
see sample input/output for the output format
explanation
for example, if the given list of integers are
2 4 5 6 7 8 2 4 5 2 3 8
the average of all the numbers is 4.67.
after sorting the array,
2 2 2 3 4 4 5 6 7 8 8
what is the pseudocode that will prepare the monthly credit card billing report of a customer. The input will contain the name of the person who has purchased on credit, the previous balance, total purchases and total payments. The output lists the name, interest and new balance.
The amount subject to a finance charge is obtained by adding the total purchases to the previous balance and subtracting the total payments. If the amount subject to a finance charge is $250 or more, interest will be calculated by multiplying this amount by 1.5 percent. Otherwise the interest is calculated as 1 percent of the amount. The new balance is obtained by adding the interest to the amount subject to a finance charge.
How do I make a float just 2 decimal point?
What will the output of this python program be?
def test_function( length, width, height):
print ("the area of the box is ",length*width*height)
return length*width*height
l = 12.5
w = 5
h = 2
test_function(l, w, h)