1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nevsk [136]
3 years ago
11

A loop that will output every other name in the names list.

Computers and Technology
1 answer:
Nuetrik [128]3 years ago
4 0

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.

You might be interested in
i emailed someone and im sure that they emailed back however it says nothing has arrived in my inbox what do I do
Lynna [10]

Answer:

report it or check ur spam mail or refresh the page

Explanation:

good luck figuring it out :)

8 0
3 years ago
How long will my chromebook last if it is at 30 percent
Marta_Voda [28]

Answer:

You can see an estimated battery life time.

Explanation:

To see it simply put your mouse over the battery icon, don't click it and it should give you the life it has left in hours:minutes format.

5 0
3 years ago
A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set
Vanyuwa [196]

Answer:

from functools import reduce

def mean(mylist):

   score = reduce(lambda x,y: x + y, mylist)/ len(mylist)

   return score

def median(mylist):

   sorted(mylist)

   list_len = len(mylist) % 2

   i = round(len(mylist)/2)

   x = len(mylist)//2

   if list_len == 0:

       median = (mylist[x] + mylist[x+1]) / 2  

   else:

       median = mylist[i]

   return median

def mode(mylist):

   unique = set(mylist)

   unique = list(unique)

   collector = [mylist.count(key) for key in unique]

   maxi = max(collector)

   loc = collector.index(maxi)

   return unique[loc]

def main():

   scores = input( 'Enter list of numbers: ').split(",")

   scores = [int(score) for score in scores]

   

   operation = input('Enter operation: ')

   operator = ['mean', 'median', 'mode']

   

   for x in iter(list, 0):

       if operation in operator:

           break

       print("Invalid operation: ")

       operation = input('Enter operation')

   

   index_loc = operator.index(operation)

   

   if index_loc == 0:

       return mean(scores)

   elif index_loc == 1:

       return median(scores)

       #return np.median(scores)  can be used of the defined function

   elif index_loc == 2:

       #return stats.mode(scores)[0]  can be used of the defined function

       return mode(scores)

print( main( ) )

Explanation:

The main python function calls conditionally three statistical functions namely mean, median and mode. It prompts for user input for a list of integer numbers and a function name name to return the corresponding result.

8 0
3 years ago
C++
Ede4ka [16]

Answer:

2 & 3

Explanation:

Only mathematical operations that can be used to change contents of pointer variables include addition, subtraction, comparison, increments and decrements.

Although modulus, division and multiplications are not possible. A snippet of code is attached showing pointers addition and subtraction and their result.

Check it by replacing + or - signs with *, / or % which represent multiplication, division and modulus respectively. It would result in an error.

4 0
3 years ago
Draw an E-R diagram for the following situation:
VladimirAG [237]

Answer:

Hi there! This question is good to check your knowledge of entities and their relationships. The diagram and explanation are provided below.

Explanation:

The entity relationship diagram for the association between the entities according to the description in the question is drawn in the first attachment. We can further simplify the relationship by removing this many to many relationship between "Chemists" and "Projects" by adding another entity called "Worklist" as detailed in second attachment.

4 0
3 years ago
Other questions:
  • Microsoft ____ is the new web browser.
    13·2 answers
  • What is a packet?
    10·1 answer
  • Write a recursive method called repeat that accepts a string s and an integer n as parameters and that returns s concatenated to
    7·1 answer
  • A __________ is a repository of data gathered from operational data and other sources that is designed to serve a particular com
    7·1 answer
  • We want to use image processing to detect cats in images, how do you do it? Please write down the steps.
    9·1 answer
  • Match each method of communication with its intended purpose.
    14·1 answer
  • A photographer stores digital photographs on her computer. In this case the photographs are considered the data. Each photograph
    6·1 answer
  • Help I will mark brain list I promise!!
    5·1 answer
  • The __________ contains the basic elements of a user's program and can be generated directly from a compiled object file
    15·1 answer
  • You are asked to analyze events in a firewall log that occurred six months ago. when you analyze the log file, you notice events
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!