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
A user calls your help desk and says that he is trying to configure his Word document so that the text within his paragraphs is
katrin [286]

Answer:

The best answer would be

Explanation:

To access this command ...

Select the Format tab - Properties - Paragraph properties - Bleeds and spaces

7 0
3 years ago
What are the benefits of building blocks?
BartSMP [9]

I'm not sure if this is what you're looking for but you can benefit from using the Building Blocks feature in Word. Building blocks are pieces of document content or pre-defined items, like tables, lists, headers, and text boxes. They can be used again and again in Word files on your computer.

Hope this helps

8 0
3 years ago
Read 2 more answers
"Memory refers to: A.the brain processes involved in the encoding, storage, and retrieval of information. B.the mechanisms drivi
natali 33 [55]

Answer: A

Explain:

you can use memory on a computer to retrieve passed data if your referring to brains memory that is memory of passed events

memory:1 the faculity by which the mind stores and members information

2 something remembered from the past a recollection

8 0
3 years ago
Universal Containers (UC) uses a custom object called Vendor. The Vendor custom object has a Master-Detail relationship with the
Rudik [331]

Answer:

The account record comprises of Invoice roll up summary fields.

Explanation:

The possible reason that this change was not permitted was that the account record comprises of Invoice roll up summary fields.

Invoice roll up summary fields: A roll-up summary field computes values from associated records, for example those in a linked list. a person or someone ca design a roll-up summary field to show a value in a master record by building  the values of fields in a particular record.

The detail record must be associated to the master through a master-detail relationship. for instance, you want to show the sum of invoice amounts for all linked custom object records in an account’s Invoices related list. you can show the whole or sum in a custom account field refereed to as Total Invoice Amount.

4 0
3 years ago
class student_record { public: int age; string name; double gpa; }; Implement a void function that has five formal parameters: a
Setler79 [48]

Answer:

void delete_record(student_record *arr, int &size, int age, string name, double gpa) {

int index = -1;

if (arr != NULL && size > 0) {

for (int i = 0; i < size; ++i) {

if (arr[i].age == age && arr[i].name == name && arr[i].gpa == gpa) {

index = i;

break;

}

}

}

if (index != -1) {

for (int i = index; i < size - 1; ++i) {

arr[i] = arr[i + 1];

}

size--;

}

}

8 0
3 years ago
Other questions:
  • Create a project for a sandwich shop. The project, named SalsSandwiches, allows a user to use a ListBox to choose a type of sand
    5·1 answer
  • Conduct online research to determine specific conflict-resolution and management techniques and skills that would be beneficial
    5·1 answer
  • When dealing with a person who is behaving violently you should argue with them. A. False B. True
    5·1 answer
  • Why laptop computer is called micro computer?​
    8·1 answer
  • Write a regular expression that selects lines containing any of the following words: linux windows solaris macos. For this exerc
    13·1 answer
  • A technician has been asked to upgrade a processor and needs to do some research. The computer is just a couple of years old. Wh
    13·1 answer
  • The use of Quick Styles is a great way to save
    15·1 answer
  • Write a program to read from std_info.txt.
    11·1 answer
  • When you create a new database using --------- , the database includes prebuilt tables and forms which you can populate with dat
    15·1 answer
  • Scientist Galileo Galilei used the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!