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]
2 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]2 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
If you have 60fps on your laptop tell me one way you can go to 240fps
choli [55]

Answer: NO

Explanation:

A 60hz monitor refreshes the screen 60 times per second. Therefore, a 60hz monitor is only capable of outputting 60fps

4 0
2 years ago
Read 2 more answers
What device provides ports to allow a laptop to easily connect to a full-sized monitor, keyboard, ac power adapter, and other pe
Snezhnost [94]

The device that provides ports to allow a laptop to easily connect to a full-sized monitor, keyboard, ac power adapter, and other peripheral devices is Docking Station.

6 0
2 years ago
You wish to enter your exam scores in a spreadsheet. Which function will help you find how each subject’s score relates to the o
tester [92]

Answer:

Its the VLookup and the HLOOKUP.

Explanation:

And it depends upon the manner in which the marks are mentioned. If they are mentioned in row then we use Hlookup, and if in columns then we use vlookup.

And the syntax for vlookup is :

vlookup(lookup value, range containing the lookup value, column number in range containing the return value, approximate 0 or exact value 1)

8 0
3 years ago
The sum of all the minterms of a boolean function of n variables is equal to 1.
Aleksandr-060686 [28]

The answers are as follows:

a) F(A, B, C) = A'B'C' + A'B'C + A'BC' + A'BC + AB'C' + AB'C + ABC' + ABC

= A'(B'C' + B'C + BC' + BC) + A((B'C' + B'C + BC' + BC)

= (A' + A)(B'C' + B'C + BC' + BC) = B'C' + B'C + BC' + BC

= B'(C' + C) + B(C' + C) = B' + B = 1


b) F(x1, x2, x3, ..., xn) = ∑mi has 2n/2 minterms with x1 and 2n/2 minterms

with x'1, which can be factored and removed as in (a). The remaining 2n1

product terms will have 2n-1/2 minterms with x2 and 2n-1/2 minterms

with x'2, which and be factored to remove x2 and x'2, continue this

process until the last term is left and xn + x'n = 1

4 0
3 years ago
Choose the words that make the following sentence true.<br> Primary memory is
ki77a [65]

Answer:

Primary memory is computer memory that is accessed directly by the CPU

Explanation:

8 0
2 years ago
Other questions:
  • Many shops are simply plugging up their drains to keep from inadvertently violating the law and creating environmental contamina
    15·1 answer
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for memory addressing if the smallest ad
    10·1 answer
  • What does a data bar in a cell represents​
    12·2 answers
  • ABC software company is to develop software for effective counseling for allotment of engineering seats for students with high s
    13·1 answer
  • What are the TWO methods of copying and pasting on the AutoCAD Clipboard function?
    7·1 answer
  • Which of the following would be useful to understand if you wanted to build a web page
    15·1 answer
  • Can someone please help me with 6.8 Code Practice adhesive.
    14·2 answers
  • Please help i will give you brainiest and 5 stars answer the question!!!!!!!!!!!!!!!!!!!!!!!!!
    7·1 answer
  • EASY What does the Backspace key do?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!