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
777dan777 [17]
3 years ago
5

MyProgramming Lab

Computers and Technology
1 answer:
Akimi4 [234]3 years ago
4 0

Answer:

Explanation:

The following code is written in Python. It creates a method for each one of the questions asked and then tests all three with the same test case which can be seen in the picture attached below.

def alternating_list(lst1, lst2):

   lst3 = []

   for x in range(len(lst1)):

       lst3.append(lst1[x])

       try:

           lst3.append(lst2[x])

       except:

           pass

   if len(lst2) > len(lst1):

       lst3.extend(lst2[len(lst1):])

   return lst3

def reverse_alternating(lst1, lst2):

   lst3 = []

   if len(lst1) == len(lst2):

       for x in range(len(lst1) - 1, -1, -1):

           lst3.append(lst1[x])

           lst3.append(lst2[x])

   return lst3

def alternating_list_no_extra(lst1, lst2):

   lst3 = []

   max = 0

   if len(lst1) > len(lst2):

       max = len(lst2)

   else:

       max = len(lst1)

   for x in range(max):

       lst3.append(lst1[x])

       try:

           lst3.append(lst2[x])

       except:

           pass

   return lst3

You might be interested in
What is 30 x 30 x 30 x 30
frez [133]
810,000 i asked siri
4 0
3 years ago
Read 2 more answers
How did technology change the world
Crank

Answer:

Technology has changed the world for the better.

Explanation:

Without technology, many of the things we take for advantage, such as, credit cards, calling people from far distances, heck even being able to call to across the world from where you are right now. Technology has revolutionized many things we use commonly on a day-to-day basis.

3 0
2 years ago
Read 2 more answers
Bob flys a drone which has a 20 megapixel camera attached, what is the definition of "megapixel in this context? Why does it mat
Verizon [17]

Answer:

megapixel refers to the unit of resolution i.e. one million

Explanation:

Interestingly the higher the pixels does not mean higher quality of image, it's more about the camera and it's sensor.

I am a photographer and a licensed drone pilot and have researched the subject to help with camera choice, both DSLR and drone.

5 0
3 years ago
Write a python program that will accept monthly salary amounts greater than zero but less
Naily [24]

Answer:

b=0

c=0

lol=list()

while True:

   salary=input("Enter your salary: ")

   if salary=="e" or salary=="E":

       print("Thankyou!!")

       break

   else:

       a=int(salary)

       if a>=300000 and a<=400000:

            c=c+1

       if a<0 or a>400000:

           print("Your salary is either too small or too big ")

       if a>0 and a<=400000:

           a=a-(25/100*a)-(5/100*a)-(2/100*a)

           lol.append(a)

           b=b+1

           if a>=300000:

                c=c+1

print(lol)

print("The number of salaries entered is: "+ str(b))

print("The number of salaries that exceeded 300000 is: "+str(c))

3 0
3 years ago
Rewrite the following condition to avoid a possible arithmetic exception:
dangina [55]

Answer:

if (x > 7 && Math.sqrt(x) < 3)

Explanation:

The previous condition checks if the square root of x is less than 3, but this would raise an error if x is a value equal to or less than 0.

So, the condition checks for the value of x before evaluating the square root after the AND operation to prevent an arithmetic exception.

4 0
2 years ago
Other questions:
  • How do you transfer music from external hard drive to a laptop?
    13·1 answer
  • What are the two main components on the motherboard?
    12·2 answers
  • Audio editing software contains several codecs that allow you to
    15·1 answer
  • Matching: match each step with its correct sequence number. This question tests whether you know the order in which a CPU perfor
    14·1 answer
  • Tech A states that modern vehicles use asbestos as the brake material. Tech B states that asbestos is no longer used in brakes.
    8·1 answer
  • What happen if there is no authentication??
    10·2 answers
  • The goal of this project is to become familiar with basic Python data processing and file usage. By the end of this project, stu
    8·1 answer
  • Assume the user types in 7 for x and 2 for y. What is output by the
    6·1 answer
  • Which example best demonstrates an impact of computers on the economy?
    11·2 answers
  • A____consists of many users and their information.​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!