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 should you do if a headset plugged into your computer is not working properly.
NemiM [27]
Ether get a new headset or take out the plug blow on it or wipe it or clean the inside of the computer where the headset wire goes
7 0
2 years ago
Advantages of a personal area network
Ratling [72]
The main advantage is the security, the pan is a personal network of one or two person so there is no risk of any leak of data, best way to share resources each other via bluetooth

4 0
3 years ago
How does a firewall provide network security
ehidna [41]
Firewalls are connected with a network device which blocks untrusted network forming a barrier in between trusted and un-trusted network.
8 0
3 years ago
This term is also called live, or hot, which means that a voltage is present and it can cause an electrical current. Any time an
tangare [24]
B. Energised although this is not as common
3 0
3 years ago
Silvia fue a una revisión odontológica porque tiene problemas de salud en la dentadura y sus cepillos sólo duran dos semanas. Ah
Neko [114]

Answer: ella puede usar un cepillo de dientes eléctrico

8 0
2 years ago
Other questions:
  • To apply the rule of thirds you first? PLZ HURRY AND ANSWER THIS
    5·2 answers
  • Please help with this
    5·2 answers
  • In what ways are Outlook notes useful for personal or professional use? Check all that apply.
    13·2 answers
  • A ____ is a theoretical model of computation that includes a (conceptual) tape extending infinitely in both directions.
    13·1 answer
  • You can install several printers on your machine, but at least one must be the _______ printer.
    6·1 answer
  • Which of these is the proper flow for an Auto Trans cooling system?
    7·2 answers
  • What is it called when servers on the Internet supply applications as a service, rather than a product
    14·1 answer
  • First person to make me laugh will get brainliest.​
    10·2 answers
  • De acuerdo con las generaciones de la computación, ¿Creen que estamos en la 5ta generación o aun no? y ¿por qué?
    13·1 answer
  • Effective online learning method for students
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!