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
Vinvika [58]
3 years ago
10

Given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of lis

t1 and list2 (that is, the first element of list1 followed by the first element of list2 , followed by the second element of list1, followed by the second element of list2, and so on. Once the end of either list is reached, the remaining elements of the longer list is added to the end of the new list. For example, if list1 contained [1, 2, 3] and list2 contained [4, 5, 6, 7, 8], then the new list should contain [1, 4, 2, 5, 3, 6, 7, 8]. Associate the new list with the variable list3.
Computers and Technology
1 answer:
tester [92]3 years ago
5 0

Answer:

The following code is written in Python Programming Language.

Program:

list1=[1,2,3]

 # initialized the list type variable

list2=[4,5,6,7,8]

  # initialized the list type variable

list3=[]

   # initialized the empty list type variable

for j in range(max(len(list1), len(list2))):   #set for loop

 if j<len(list1):

  #set if statement

   list3.append(list1[j])

  #value of list1 appends in list3  

 if j<len(list2):

   #set if statement

   list3.append(list2[j])

  #value of list2 append in list3

print(list3)    #print the list of list3

Output:

[1, 4, 2, 5, 3, 6, 7, 8]

Explanation:

Here, we define three list type variables "list1", "list2", "list3" and we assign value in only first two variables "list1" to [1, 2, 3] and "list2" to [4, 5, 6, 7, 8] and third list is empty.

Then, we set the for loop and pass the condition inside it we pass two if conditions, in first one we compare the list1 from variable "j" inside it the value in list1 will append in list3, and in second one we compare "j" with list two and follow the same process.

After all, we print the list of the variable "list3".

You might be interested in
Lets assume we are writing a system to backup a list of transactions: class Transaction 1 String TransactioniD: Date TranactionT
zhannawk [14.2K]

Answer:

The answer is "Option d"

Explanation:

In this question, the easiest way that will save the payment on your database in such a process ID-sorting list would be to mark a payment, that's been recorded mostly on the database whenever this payment became used serial number is not transaction ID, and the wrong choice can be defined as follows:

  • In choice a, It is wrong because it may be processed, however, payments aren't entered through our process, which does not help remove older.
  • In choice b, the unordered list would not enable any transaction to only be retrieved, that's why it is wrong.
  • In choice c, it will not be helpful because the includes video is either begin or complete the payment, it will not be helpful to hold it with transaction time.
  • In choice e, this approach won't help to identify the payments since one date will have a lot of payments over a certain account.
6 0
3 years ago
The display in D1 should read Colin McCain what text function should be used
Kaylis [27]

Answer:

The answer is "SUBSTITUTE(D1,"c","C",1)"

Explanation:

In the given question, some information is missing, that is an option so, the correct option can be described as follows:  

  • Many of us use the Bulletin feature, which is available in MS-Excel.  In these function the SUBSTITUTE is a method, that is used in Builtin to aim the functions to locate a string or character and to replace with the selected module.  
  • In the case of the end-user, it would like to replace "c" with a capital letter "C." And displays cell shifts in D1. This method uses 4 parameters, in which first describes cell reference, second string to located, third replacing string, and fourth its length.
8 0
3 years ago
What should you do if you do not have the experience required for the job you want?
Alla [95]

Answer:

try to get an internship and learn more and gain experience and you can resign and apply for the job you want

Explanation:

hope this helps

please like and Mark as brainliest

4 0
3 years ago
Ben is writing web page content on a newly launched gaming gadget. He has to use hyperlinks to help visitors navigate to web pag
iren2701 [21]

Answer:

at the bottom of the web page

Explanation:

Ben is creating a web page content for the gaming gadget that  has been newly launched. He uses hyperlinks so that the visitors can navigate the web pages properly which deals with some other electronic gadgets also. So Ben should place the hyperlinks at the bottom of the web page as it will provide anyone viewing the web pages easily.

3 0
3 years ago
The word font refers to the style of lettering but not the color.<br> true or false
Lilit [14]
The answer for this  is true .
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of these categories of computer software can add thousands of dollars to the cost of a computer system?
    13·1 answer
  • Which function in Spell Checker should Patrick use if he makes the same mistake frequently when typing emails?
    11·1 answer
  • Which are benefits of modeling a solution? Choose all that apply. allows you to be sure the problem and solution are understood
    9·2 answers
  • If you can log nto a website to add, edit, or delete content that has been added by you or another user , you are most likley us
    8·1 answer
  • 15
    5·2 answers
  • Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of
    8·1 answer
  • -) An attribute is a(n)?
    5·1 answer
  • ¿cuáles son los usos que se le pueden dar a una bicicleta?
    6·1 answer
  • What is a feature of Accenture’s myNav platform?
    5·1 answer
  • The it components of an erp system architecture include the hardware, software and the ________
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!