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
When you tell an acquaintance your telephone number, you do not recite the digits one by one at a constant rate, as in "3, 3, 7,
yKpoI14uk [10]

Answer:

chunking and short-term is the correct answer of this question.

Explanation:

chunking is a strategy to enhance a short-term memory.

Chunking is an method used to separate larger numbers that can not be psychologically separated.Chunking is the grouping of words in one sentence into short, important phrases. A chunk is the material segment that is used in many graphical formats, such as PNG etc.

Short-term memory is the knowledge a person is considering or is conscious of. This is also called healthy or main memory.

3 0
3 years ago
Describe psychographic differences among the past five generations of Americans that you learned about in this course. What type
Hunter-Best [27]

i would love to help i just dont understand

7 0
2 years ago
You used a website to learn about the child-rearing practices in China. Your study is related most to which aspect
ozzi

Answer:

c. culture

Explanation:

I think your study is related to their culture

5 0
2 years ago
Read 2 more answers
When you move into a new home or apartment, the first thing on your checklist should be to have the ____________ changed. (5 Let
Lynna [10]

Answer:

When you move into a new home or apartment, the first thing on your checklist should be to have the <u>locks</u> changed

Explanation:

Changing the locks

Given that the way the previous owners of the new home or apartment made use of the locks and the keys are usually not completely known to the new owners, one may never know all those that have a key or a means to gain access into the apartment or home. Therefore, in order to guarantee proper security, it is a good practice to have as one of the first thing on the checklist, the changing of the locks of the entrance doors and windows of the new home or apartment.

5 0
2 years ago
Write a machine code program for all the following problems. Test to make sure that they work in LC3. It's best to complete each
Usimov [2.4K]

Answer:

Following is given the solution to each part.

All the comments are given above each step so that they can make the logic clear.

I hope it will help you!

Explanation:

8 0
3 years ago
Other questions:
  • Use the image below to answer this question.
    14·1 answer
  • 32.
    11·1 answer
  • A ________ -tier design includes a middle layer between the client and server that processes the client requests and translates
    11·1 answer
  • Type the correct answer in the box spell all words correctly
    8·1 answer
  • . Once a vulnerability has been identified by Nessus, where would you check for more information regarding the identified vulner
    15·1 answer
  • Enterprise application integration (eai) software enables users to model the business processes and interactions that should occ
    8·1 answer
  • Maria works for MegaCorp, a large privately owned company specializing in sales of ball bearings. MegaCorp introduces filtering
    15·1 answer
  • 7.) Title text boxes on every slide must be the same format. <br> A. True <br> B. False
    15·2 answers
  • Application of computer in insurance​
    14·1 answer
  • HELPPPPP 20 POINTS CORRECT ANSWER GETS BRAINLIEST<br>sorry wrong amount of points ;-;
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!