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
vredina [299]
3 years ago
6

Write a program for any element in keysList with a value greater than 50, print the corresponding value in itemsList, followed b

y a space. Ex: If keysList = {32, 105, 101, 35} and itemsList = {10, 20, 30, 40}, print: 20 30.
Computers and Technology
1 answer:
Mamont248 [21]3 years ago
4 0

Answer:

The solution code is written in Python:

  1. keysList = [32, 105, 101, 35]
  2. itemsList = [10, 20, 30, 40]
  3. output = ""
  4. for i in range(len(keysList)):
  5.    if(keysList[i] > 50):
  6.        output += str(itemsList[i]) + " "
  7.    
  8. print(output)

Explanation:

Firstly, let us use the two sample list, keysList and itemsList in our program (Line 1-2). Then create a output variable to hold the output string (Line 4).

Next, we create a for-loop and use it to traverse through the elements in the keysList. If any keysList element is bigger than 50 then we use the same index i to get the corresponding item from itemsList and join that value to the output string (Line 7-8).

Lastly, we print the output (Line 10).

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
In a c program, if you see a variable in main declared: float farray[20]; describe what farray is
Bas_tet [7]
An array of floats that can hold up to 20.
3 0
3 years ago
16. If a user can make modifications to database objects, what permission has that
Vsevolod [243]

B

Explanation:

The Alter command is used when we want to modify a database or object contain in database.

5 0
2 years ago
What is an easy and accurate way that a graphic designer can increase the size of a digital shape while keeping the ratio of hei
VikaD [51]

Answer:

Open the shape’s properties window, and type the height value multiplied by 2 and the width value multiplied by 3.

Explanation:

7 0
3 years ago
Read 2 more answers
Asymmetric encryption uses (choose all that apply):
yan [13]
Asymmetric uses two different keys (Public keys and private keys) for both encryption and decryption of data.  It is s any cryptographic<span> system that uses pairs of keys: public keys which may be distributed widely, and private keys which are known only to the owner.</span>
7 0
3 years ago
Other questions:
  • If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
    6·1 answer
  • I need help to find out what is wrong with this program and my variable, "exponent" comes out as 0 in the output instead of the
    14·1 answer
  • To write 10 lines of code on paper:
    10·1 answer
  • Your friend sees an error message during Windows startup about a corrupted bootmgr file. He has another computer with a matching
    12·1 answer
  • Lenovo's ThinkPad laptop computers is designed in the United States, the case, keyboard, and hard drive are made in Thailand; th
    14·1 answer
  • What kind of value should an employee possess when employees are expected to be responsible and fair?
    7·1 answer
  • Match the items with their respective descriptions.
    6·2 answers
  • What is emerging as a major business area of innovation that offers a flexible collection of computers on the internet that can
    6·1 answer
  • Claire writes a letter to her grandmother, in which she describes an amusement park she visited last week. She adds pictures of
    13·1 answer
  • Supp guees how your dayyyyyyyyyyyy
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!