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
Which of the following describe a required
ELEN [110]

Answer:

The last 2 point in the given question is the correct answer to the given question i.e

  • an argument passed to the function in the  correct positional order
  • an argument wherein the number of  arguments in the function call should match  the definition of the function.

Explanation:

The required  argument are those argument that are passing to the method the in the right location order.In the required argument the number of arguments in the call method must match the definition of the function .

For example

def fun( s ): #function definition  

   print(s) #display s

fun('er')#calling

In this example  there is  function fun() in which we pass the argument 'er'  we call that function from main() .The control moves to the function definition it checks the number of argument in the calling function fun() is matched with the definition of function fun()  and print 'er'.

All the other option are not describing the required  argument that's why this is incorrect option .

8 0
3 years ago
Consider the latency model for static congestion windows. If the server receives an acknowledgement for the first data segment i
Angelina_Jolie [31]

Answer:

Latency of an object O is shown below.

Explanation:

W segment and stalled state transmits nothing and waits for acknowledgement. The latency is 2 R TT + the time required for server that are using to transmit the object + the amount of time when server is in stalled state. Let K be the number of window that is K= O/WS .The serveries stalled state where K-1 is period of ime with period lasting RTT-(W-1)S/R

latency = 2RTT +O/R +(K-1)[S/R +RTT - WS/R]

After combining the two case

latency = 2 RTT + O/R + (K-1)[S/R +RTT - WS/R]

where [x] means maximum of (x.0). This is the complete ananlysis of the static windows.

server time for transmit the object is (K-1)[S/R +RTT - WS/R]

7 0
3 years ago
Assume that source elements of length k are mapped in some uniform fashion into a target elements of length p. If each digit can
lukranit [14]

Answer And explanation

a)

r^k has 1/r^k probability guess the correct source

b)

Each element in r^p  is mapped by r^k / r^p . There are r^k^-^p  So there are  r^k^-^p -1 elements.

number of target elements = r^k^-^p

number of source elements = r^k^-^p -1

probability = r^k^-^p -1 /r^k

c) Probability of the correct target element

1/r^p

6 0
3 years ago
What is the next line?
jonny [76]

Answer:

Answered below

Explanation:

The next line is 1.

The python count function returns the number of times an element appears in a tuple or a list.

In the tupleB tuple, 7 is passed into the count function. The number of times 7 appears in tupleB is just once alongside 5, 2.7, 10 and 5. Therefore, the count function returns 1 in the next line.

5 0
2 years ago
SSDS are ______ than magnetic hard disks
Deffense [45]
The answer is 1 faster
6 0
3 years ago
Other questions:
  • Write a program that reads in 10 numbers from the user and stores them in a 1D array of size 10. Then, write BubbleSort to sort
    13·1 answer
  • LargeCo is planning a new promotion in Alabama (AL) and wants to know about the largest purchases made by customers in that stat
    7·1 answer
  • The ash and dust from a volcanic eruption can cause a _______ change in the environment.
    13·1 answer
  • Select the correct answer.
    15·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    5·1 answer
  • William is an HR manager in a textile-manufacturing firm. He is creating a file on the hours each employee worked during the las
    6·2 answers
  • Processor is used to process the data.<br>A)true <br>B)False​
    13·1 answer
  • Write: In a five-paragraph essay that is two to three pages in length, address the
    13·1 answer
  • What does the top level domain in a url inducate? A. The organization or company that owns the website. B. The organization or c
    6·2 answers
  • Why might a company choose Linux for its operating system instead of Microsoft Windows or Mac OS? The company's employees can sy
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!