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
miv72 [106K]
3 years ago
8

Create a list of strings based on a list of numbers The rules:_______

Computers and Technology
1 answer:
Delicious77 [7]3 years ago
3 0

Answer:

listNumbers = [34,56,23,56,78,89,98,45,34,33,25,26,67,78]

listString = [ ]

for i in range(14):

   if listNumbers[i]%2!=0 and listNumbers[i]%5==0:

       listString.append("five odd")

   elif listNumbers[i]%5==0 and listNumbers[i]%2==0:

       listString.append("five even")

   elif listNumbers[i]%2==0:

       listString.append("even")

   elif listNumbers[i]%2!=0:

       listString.append("odd")

print(listNumbers)

print(listString)

Explanation:

In python programming language;

  1. Create two lists
  2. The first is a list of numbers and initialize it with random values: listNumbers = [34,56,23,56,78,89,98,45,34,33,25,26,67,78]
  3. The second list is empty and will hold the string values listString = [ ]
  4. Use a for loop to iterate over all the elementts in the list of numbers
  5. Use the modulo operator (%) to chech for multiples of particular numbers as stipulated by the question
  6. Use combination of if/elif statements for each condition
  7. Use the .append method to add the elements into the list of strings
  8. finially output both lists

See attached code and output

You might be interested in
Files and folders in UNIX can be removed using the
wel

<em>Files and folders in UNIX can be removed using the</em>  <u><em>rm command.</em></u>

<em>The answer is B. rm command </em>

<em>Hope this helps :)</em>

3 0
3 years ago
Help me guys..<br>thankyou​
Rainbow [258]

Answer:

spoon

excess

level

1/2 cup

whatever dry ingredient u have

Explanation:

7 0
3 years ago
What kind of environment is a PC?​
balandron [24]

Answer:

In computer software, an operating environment or integrated applications environment is the environment in which users run application software. The environment consists of a user interface provided by an applications manager and usually an application programming interface (API) to the applications manager.

Explanation:

7 0
3 years ago
Assume you have an XML Tree variable called quiz initialized with the following valid XML document. You are not required to draw
blagie [28]

Answer:

See explaination.

Explanation:

question is the root element which have two children one is M-C and other is Coding.

Again M-C have two sub children Points and parts

Note: The tree will be as shown in the attachment. kindly refer to attachment.

Here if we see the child of quiz(questions) at 0 position is number of type M-C and another child at location 1 is number of type Coding.

Now quiz.child(0) is number of type M-C which has two child and child at 0 is Points and child at 1 is Parts

quiz.child(0).child(1) is Points and now further points doesn't have any children hence going further to quiz.child(0).child(1).child(0) is nothing hence it will not return anything.

Next quiz.child(1) is number of type coding and value is 5.

Size of the tree is (2^depth)-1

and here depth of tree is 3 hence size is (2^3)-1 i.e. 7

8 0
3 years ago
What does a primary key allow a user to do in a database?<br><br> PLEASE HELP
NeTakaya

A primary key is the field (or fields) that is often employed to specifically identify each record in a table.

<h3>What is the role of this key?</h3>

The Primary key is known to be the key that helps a user to be able to form a specific identifier for each row in one's table.

Note that  it helps a person to link your table to other tables and as such, a  primary key is the field (or fields) that is often employed to specifically identify each record in a table.

Learn more about  primary key from

brainly.com/question/12001524

#SPJ1

5 0
2 years ago
Other questions:
  • What is one problem you should keep in mind when researching information on the Internet?
    6·2 answers
  • You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
    5·1 answer
  • How is an amp meter connected in a circuit to measure flow of electrons
    15·2 answers
  • Anyone got the edmentum computer programming post test answers?
    6·1 answer
  • Describe three perimeter intrusion detection systems and give an example of one that you have seen deployed either at work or an
    8·1 answer
  • SNMP is a protocol used to query hosts, servers, and devices about performance or health status data. This protocol has long bee
    7·1 answer
  • PLEASE HELP!
    14·2 answers
  • Explain the function of different flags in the 8086<br>​
    12·1 answer
  • By convention only, either the first usable address or the last usable address in a network is assigned to the router (gateway)
    11·1 answer
  • Electrical data suitable for transmission is called a(n)
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!