Answer:
- def median(l):
- if(len(l) == 0):
- return 0
- else:
- l.sort()
- if(len(l)%2 == 0):
- index = int(len(l)/2)
- mid = (l[index-1] + l[index]) / 2
- else:
- mid = l[len(l)//2]
- return mid
-
- def mode(l):
- if(len(l)==0):
- return 0
-
- mode = max(set(l), key=l.count)
- return mode
-
- def mean(l):
- if(len(l)==0):
- return 0
- sum = 0
- for x in l:
- sum += x
- mean = sum / len(l)
- return mean
-
- lst = [5, 7, 10, 11, 12, 12, 13, 15, 25, 30, 45, 61]
- print(mean(lst))
- print(median(lst))
- print(mode(lst))
Explanation:
Firstly, we create a median function (Line 1). This function will check if the the length of list is zero and also if it is an even number. If the length is zero (empty list), it return zero (Line 2-3). If it is an even number, it will calculate the median by summing up two middle index values and divide them by two (Line 6-8). Or if the length is an odd, it will simply take the middle index value and return it as output (Line 9-10).
In mode function, after checking the length of list, we use the max function to estimate the maximum count of the item in list (Line 17) and use it as mode.
In mean function, after checking the length of list, we create a sum variable and then use a loop to add the item of list to sum (Line 23-25). After the loop, divide sum by the length of list to get the mean (Line 26).
In the main program, we test the three functions using a sample list and we shall get
20.5
12.5
12
Answer:
Macronutrients are simply nutrients the body needs in a very high amount e.g Carbohydrate.
MicroNutrients are simply nutrients the body needs but in little amount e.g Minerals.
Explanation:
So for further breakdown:
What are nutrients? Nutrients are essential elements that nourish the body in different capacities. We as humans get most of out nutrients from the food and water we ingest.
Now about Macro Nutrients: From the prefix "Macro" which means large, we can infer that macro nutrients are elements need by the body for the fundamental processes of the body, deficiency in this nutrients are very easy to spot. Examples are: Carbohydrates, Protein, Fats amd Water.
Micro Nutrients: In relation to macro nutrients this are elements that the body needs but are not needed in Large quantities. They mostly work like supporting nutrients. Most chemical activities like reaction that occur in the body are a function of micro nutrients. Defiencies in micrp nutrients may take some time to spot e.g Minerals and Vitamins
In regards to exercise: Macro nutrients are the essential ones here since they are the ones that generate energy. PS: micro nutrients dont generate energy.
In regards to rest: Both the Macro and Micro Nutrients are essentail for the overall well being of the body.
Answer:d
Explanation:
Given
Temperature
Also 
R=287 J/kg
Flow will be In-compressible when Mach no.<0.32
Mach no.
(a)
Mach no.
Mach no.=0.63
(b)
Mach no.
Mach no.=0.31
(c)
Mach no.
Mach no.=1.27
(d)
Mach no.
Mach no.=0.127
From above results it is clear that for Flow at velocity 200 km/h ,it will be incompressible.
Answer:
γ
=0.01, P=248 kN
Explanation:
Given Data:
displacement = 2mm ;
height = 200mm ;
l = 400mm ;
w = 100 ;
G = 620 MPa = 620 N//mm²; 1MPa = 1N//mm²
a. Average Shear Strain:
The average shear strain can be determined by dividing the total displacement of plate by height
γ
= displacement / total height
= 2/200 = 0.01
b. Force P on upper plate:
Now, as we know that force per unit area equals to stress
τ = P/A
Also, τ = Gγ
By comapring both equations, we get
P/A = Gγ
------------ eq(1)
First we need to calculate total area,
A = l*w = 400 * 100= 4*10^4mm²
By putting the values in equation 1, we get
P/40000 = 620 * 0.01
P = 248000 N or 2.48 *10^5 N or 248 kN
Answer:
/* C Program to rotate matrix by 90 degrees */
#include<stdio.h>
int main()
{
int matrix[100][100];
int m,n,i,j;
printf("Enter row and columns of matrix: ");
scanf("%d%d",&m,&n);
/* Enter m*n array elements */
printf("Enter matrix elements: \n");
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
scanf("%d",&matrix[i][j]);
}
}
/* matrix after the 90 degrees rotation */
printf("Matrix after 90 degrees roration \n");
for(i=0;i<n;i++)
{
for(j=m-1;j>=0;j--)
{
printf("%d ",matrix[j][i]);
}
printf("\n");
}
return 0;
}