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
forsale [732]
3 years ago
6

In Python, what is returned when evaluating [n for n in range(10) if n % 2]?​

Computers and Technology
1 answer:
Firlakuza [10]3 years ago
8 0
First we need to understand what "n for n in range(10)" means. Basically, we are iterating through all the values n that are in the range of 10 (meaning 0, 1, 2, 3, ..., 9).

Next we are evaluating if n%2. The percentage sign is used to represent modulus which is the remainder of when two numbers are divided. In this case, we are dividing n by 2, and the remainder is our result. When dividing by 2, the only possible remainders are 0 or 1, which when used in an if statement represent the boolean vlaues false and true, respectively. We are doing this calculation for each n from 0 to 9, and if the result is true, we output n to an array.

The numbers that will result in true (a remainder of 1) are the odds numbers. For example, 4/2 = 2 with nothing left over while 5/2 = 2 with 1 left over.

So the following is returned:

[1, 3, 5, 7, 9]
You might be interested in
The _____ layer addresses how the software will execute on specific computers and networks.
lidiya [134]

The problem domain layer addresses how the software will execute on specific computers and networks.

A problem domain is a software engineering term that refers to all information that defines a problem and compels the solution.

A problem domain basically looks at only the area you are interested in and excludes the rest. It includes the goals the problem owner wishes to have and the context in which the problem exists. For example, if you are creating a website for selling artwork online, the problem domain will be artwork and eCommerce.

Therefore, in order to identify a problem domain, you need to know the relevant user requirements. This can be easy when you start by finding out what people (users) think the problem is.

#SPJ4

3 0
2 years ago
Read 2 more answers
Which of the following is a table which can be rearranged to analyze data in a variety of ways?
Korvikt [17]

Answer:

A. Pivot Table

Explanation:

Given that a Pivot Table is a form of a table in statistics that comprises various data of several tables in a shortened form.

This table is then used to carry out analysis of data in numerous ways to reach a meaningful conclusion to make a decision.

Hence, in this case, the correct answer is a PIVOT TABLE.

5 0
3 years ago
You are planning to depart on a flight from area 2 to area 4 in 12 hours. What weather is forecast to occur along your route?
Andre45 [30]
It depends on where you live!
5 0
2 years ago
Suppose you want to delete an existing file from within Word. What would you do? A. Click on the File button, choose Recent, ope
koban [17]
The asnwer would be A
7 0
3 years ago
List three types of Software:
Elodia [21]

Answer:

ummm

Explanation:

Freeware

Open Source

Shareware

5 0
3 years ago
Other questions:
  • 8 POINTS!!!!!!!!
    6·2 answers
  • Technician A says that PTC heaters can be built into a conventional heater core assembly. Technician B says that a PTC heater's
    11·1 answer
  • When was the federal commission act put into effect?????
    13·1 answer
  • The process known as "bitmapping" is defined as information in _____. PLEASE HELP FAST
    11·1 answer
  • If your internet were to go out, what steps would you take to troubleshoot to restore your service?
    15·1 answer
  • modified true or false analyze each statement then write technical the statement is true the statement is false underline the wo
    6·1 answer
  • Debug the recursive reverseString method, which is intended to return the input String str reversed (i.e. the same characters bu
    13·1 answer
  • Me Completan Pliiiis
    10·2 answers
  • The term technology is derived from the Chinese word. it is true or false​
    9·2 answers
  • Matt uploads a malware sample to a third-party malware scanning site that uses multiple antimalware and antivirus engines to sca
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!