Answer:
c. less than 60 mi/h
Explanation:
To calculate the average speed of the bus, we need to calculate the total distance traveled by the bus, as well as the total time of travel of the bus.
Total Distance Traveled = S = 100 mi + 100 mi
S = 200 mi
Now, for total time, we calculate the times for both speeds from A to b and then B to C, separately and add them.
Total Time = t = Time from A to B + Time from B to C
t = (100 mi)/(50 mi/h) + (100 mi)(70 mi/h)
t = 2 h + 1.43 h
t = 3.43 h
Now, the average speed of bus will be given as:
Average Speed = V = S/t
V = 200 mi/3.43 h
<u>V = 58.33 mi/h</u>
It is clear from this answer that the correct option is:
<u>c. less than 60 mi/h</u>
Answer:
Explanation:
class Pet:
def __init__(self):
self.name = ''
self.age = 0
def print_info(self):
print('Pet Information:')
print(' Name:', self.name)
print(' Age:', self.age)
class Dog(Pet):
def __init__(self):
Pet.__init__(self)
self.breed = ''
def main():
my_pet = Pet()
my_dog = Dog()
pet_name = input()
pet_age = int(input())
dog_name = input()
dog_age = int(input())
dog_breed = input()
my_pet.name = pet_name
my_pet.age = pet_age
my_pet.print_info()
my_dog.name = dog_name
my_dog.age = dog_age
my_dog.breed = dog_breed
my_dog.print_info()
print(' Breed:', my_dog.breed)
main()
Answer:
<em><u>The 'shoulder' of a road is the land to the edge of the road. On most roads without pavements, the shoulder is a strip of grass or a hedgerow. This is known as a 'soft shoulder'. On a motorway, this strip of land is hardstanding, hence the name 'hard shoulder.'</u></em>
<em><u>Mark</u></em><em><u> </u></em><em><u>as</u></em><em><u> brilliant</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u>.</u></em><em><u> </u></em>
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