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
Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
Alla [95]

The program that computes the area of a circle is represented as follows:

x = int(input("Write the length of the radius of the circle: "))

area = 3.14 * x**2

print(area)

The code is written in python

<h3>Code explanation:</h3>
  • The first line of code ask the user to input the length of the radius. The variable x is used to store the user's input.
  • The variable "area" is used to store the arithmetic manipulation of area of a circle.
  • Then, we print the variable "area". This will print the actual area of the circle with the particular radius you inputted.

learn more on python program: brainly.com/question/16398286?referrer=searchResults

6 0
2 years ago
Which component of a computing device drains the battery the fastest?(1 point)
Lostsunrise [7]
The display screen since it’s always bright
8 0
3 years ago
Read 2 more answers
g Write a program that allows a user to input any text in your program. Using the tools that we have discussed, your program sho
Paladinen [302]

Answer:

Explanation:

The following function/program is written in Java. It asks the user for a sentence as an input and then splits that sentence into an array of words. Then it creates an arrayList for all of the unique words, comparing each word in the sentence with all of those in the ArrayList. If a word is found in the ArrayList it cancels the loop and moves on the next word in the sentence. Finally, it counts all of the unique words in the ArrayList and prints that total to the screen.

public static void uniqueWords() {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter a sentence:");

       String sentence = in.nextLine();

       String words[] = sentence.split(" ");

       ArrayList<String> uniqueWords = new ArrayList<>();

       for (int x = 0; x < words.length; x++) {

           boolean exists = false;

           for (int i = 0; i < uniqueWords.size(); i++) {

               if (words[x].equals(uniqueWords.get(i))) {

                   exists = true;

                   break;

               }

           }

           if (exists == false) {

               uniqueWords.add(words[x]);

           }

       }

       System.out.println(uniqueWords.size());

   }

5 0
3 years ago
Scenario: You are part of an IT group managing Active Directory for a mid-size organization. A contracted research group with th
SCORPION-xisa [38]

Explanation:

1.

the answer to the first question is <u>organizational unit</u>. this is because in this scenario that we have before us, cost is a deciding factor. a unit as this can adapt to changes, it is flexible and also not very complex

2.

answer to question 2 is <u>PDC emulator</u><u>.</u><u> </u>this emulator can perform the function synchronization of time across every domain controller that is in the domain. other of its functions are, authentication and changing of passwords.

3.

the answer to the 3rd question is <u>child domain</u><u>.</u><u> </u>It is a factor in this scenario because it works well in a situation where there is an issue of slow network connection.

6 0
3 years ago
Consider the playGame procedure below which calls on 3 other procedures: countFives, player1Move, and player2Move.
emmasim [6.3K]

Answer:

c. RETURN (count)

Explanation:

A typical return statement performs the function of terminating the execution of a function and returns control to the calling function.

Hence, there will execution resumed in the calling function at the point immediately following the call.

Another thing a return statement can do is to also return a value to the calling function.

The code RETURN (count) will

terminating the execution of a function and returns control to the calling function.

3 0
3 years ago
Other questions:
  • A(n) ____ is a predefined procedure that you can call (or invoke) when needed.
    9·1 answer
  • Consider this data sequence: "3 11 5 5 5 2 4 6 6 7 3 -8". Any value that is the same as the immediately preceding value is consi
    6·1 answer
  • Alice is adding a chart in a spreadsheet. Which option will allow you her to give the chart a suitable title and subtitle?
    11·2 answers
  • While you work on the customer’s printer, he continues chatting about his network and problems he’s been experiencing. One compl
    14·2 answers
  • What are the diffrent types of contract
    9·1 answer
  • What is a regular expression that would match any digit 1-999?
    12·1 answer
  • 12. Realizar un algoritmo que genere un número aleatorio, el usuario debe adivinar cual es el número generado para esto tendrá 3
    10·1 answer
  • Central High School has a graphics design course that is developing a historical online archive of the school. The original phot
    15·2 answers
  • What does RoHS stand for and why is RoHS compliance important?
    9·1 answer
  • Difine Mainframe Computer~<br><br><br><br><br><br><br><img src="https://tex.z-dn.net/?f=%20%5C%3A%20%20%5C%3A%20" id="TexFormula
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!