Answer:
names = ['Peter', 'Bruce', 'Steve', 'Tony', 'Natasha', 'Clint', 'Wanda', 'Hope', 'Danny', 'Carol']
numbers = [100, 50, 10, 1, 2, 7, 11, 17, 53, -8, -4, -9, -72, -64, -80]
for index, element in enumerate(names):
if index % 2 == 0:
print(element)
for num in numbers:
if num >= 0:
print(num, end = " ")
count = 0
for i in numbers:
count += i
avg = count/len(numbers)
print("sum = ", count)
print("average = ", avg)
for num in numbers:
if num % 2 != 0:
print(num, end = " ")
Explanation:
I'm stuck on the last two.. I have to do those too for an assignment.
Answer:
7 raise to power 10
Explanation:
Since there are 4 possible ways to make memory chip and 3 possible ways to manufacture mother board, so for each machines we have 7 possible ways of configurations.
So total number of ways in which these machines can be configured is 7*7*7*...*7= 7raise to power 10 possible ways
If you have only 1 method that is not overloaded, then you will not be able to call it with inappropriate parameter types, that is, if the initial type of the parameter is int, then it will not be able to get the double, float, and other values, because of this an error will occur.
For this, method overloading is created.
Method overloading is when you create methods with the same name, but only the content and parameters of the methods are/can-be completely different.