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
Nuetrik [128]
4 years ago
8

g Write a Racket function (process lst1 lst2) that processes the corresponding elements of the two lists and returns a list. If

the corresponding elements are both numbers, include the sum of the two corresponding elements in the list that is returned.
Computers and Technology
1 answer:
blagie [28]4 years ago
8 0

Answer:

  1. def process(lst1, lst2):
  2.    newList = []
  3.    for i in range(0, len(lst1)):
  4.        sum = lst1[i] + lst2[i]
  5.        newList.append(sum)
  6.    return newList
  7. list1 = [1, 3, 5, 7, 9]
  8. list2 = [2, 4, 6, 8, 10]
  9. print(process(list1, list2))

Explanation:

Firstly, create a function process that takes two input lists (Line 1). In the function, create a new list (Line 2). Use a for loop to traverse through the elements of the two lists and total up the corresponding elements and add the sum to the new list (Line 3 - 5). At last, return the new list (Line 6).

In the main program, create two sample list and use them as arguments to test the function process (Line 8 - 9). We shall get the output  [3, 7, 11, 15, 19].

You might be interested in
g write a recursive function that prints out all the even numbers between x and y inclusive if x is odd then the print out will
Reil [10]

Answer:

The function written in python is as follows:

def EvenNumbers(x, y):

    if (y < x):

         return

    if (y % 2 == 0):

         EvenNumbers(x, y - 2)

    else:

         EvenNumbers(x, y - 1)

    if (y % 2 == 0):

         print(y)

Explanation:

x represents the lower limit while y represents the upper limit.

So, the recursion will be repeated as long as x <= y

This defines the function

def EvenNumbers(x, y):

This checks if y < x. If yes, the recursion stops execution and return to the main

<em>     if (y < x): </em>

<em>          return </em>

The following if and else condition checks determines the appropriate range of the recursion.

<em>     if (y % 2 == 0): </em>

<em>          EvenNumbers(x, y - 2) </em>

<em>     else: </em>

<em>          EvenNumbers(x, y - 1) </em>

The above takes care of printing starting at x + 1 if x is odd

This checks and prints the even numbers in the range

<em>     if (y % 2 == 0): </em>

<em>          print(y)</em>

<em />

To call the function from main, make use of

EvenNumbers(x, y)

Where x and y are integers

e.g EvenNumbers(2,10), EvenNumbers(1,17), EvenNumbers(3,21)

<em>See attachment</em>

3 0
3 years ago
Jennifer has to set up a network in a factory with an environment that has a lot of electrical interference. Which cable would s
jeka57 [31]

The answer is STP (Shielded Twisted Pair) cables .

Compared to Unshielded Twisted Pair, STP offers additional safeguards against Electromagnetic interference (EMI) and crosstalk. While UTP reduces some EMI, STP cables effectively block interference and ensure high-speed performance. STP cables have a metallic foil that cancels out electromagnetic interference. They are the preferred cables that protect against high-level EMI from, power lines, radar systems, or electromagnetic fields .



6 0
3 years ago
Match each career to its various job roles. digital media coordinator digital media specialist photographer sound producer creat
Morgarella [4.7K]

Answer:

1. Digital media coordinator.

2. Sound producer.

3. Digital media specialist.

4. Photographer.

Explanation:

1. Digital media coordinator: he or she is saddled with the responsibility of creating audio and video content for use on websites.

2. Sound producer: he or she records and modifies sound and music for video games and movies through the use of specialized software application such as fruity loops.

3. Digital media specialist: he or she is saddled with the responsibility of posting content such as news, pictures, graphic designs, etc., on the Internet.

4. Photographer: he or she captures images using a camera or camcorder and edits the images using a graphic design software such as Adobe Photoshop.

3 0
3 years ago
Technician A says in computer language a 0 or 1 is called a bit. Technician B says in computer language a 0 or 1 is called a byt
pochemuha

Answer:

Technician A is right 0 or 1 is called a bit

Explanation:

In computer language, Binary system is used in which data is shown either as 0 or 1.

A bit can hold either 0 or 1.

A byte can hold 8 bits of information.

Normally we use byte to represent computer storage.

A Kilo Byte (KB) can hold 1,024 bytes of information or 1,024*8 = 8,192 bits

A Mega Byte (MB) can hold 1,024*1,024 =1,048,576 bytes

or 1,048,576*8= 8,388,608 bits

Hence 0 or 1 is called a bit not byte therefore, Technician A is right!

8 0
4 years ago
Knowing how to develop an outline well is very easy, and most students can create quality outlines in one attempt. Please select
vovangra [49]

Its False, just took the test I chose true buh it told me I was wrong so iss gotta be false.

8 0
4 years ago
Read 2 more answers
Other questions:
  • Regional culture has been affected by technology in these ways. Select all that apply. decreased educational opportunities impro
    9·2 answers
  • 40 POINTS PLZ HELP NEED ASAP!!!
    5·1 answer
  • Rock, Paper, Scissors is a two-player game in which each player chooses one of three items. If both players choose the same item
    9·1 answer
  • Write two statements to read in values for my_city followed by my_state. Do not provide a prompt. Assign log_entry with current_
    13·1 answer
  • Omnvmjsjskskskajskskzksososjfnjcjckskqnd
    10·1 answer
  • Why is the term RAW image file generally used to describe a variety of file formats, which are sometimes known as digital raw ca
    13·1 answer
  • 5. The image file format most suited for photographs is what? *
    8·2 answers
  • Is there anything I can do to fix my laptop? It is a chrome book and my school provided it. Everything is still working.If anyon
    14·2 answers
  • Can someone help me?
    14·1 answer
  • Write a program that simulates applying a "boost" to a spaceship in a spaceship race game.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!