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
Goshia [24]
4 years ago
6

Associate true with the variable is_ascending if the list numbers is in ascending order (that is, if each element of the list is

greater than or equal to the previous element in the list). otherwise, associate false with is_ascending
History
2 answers:
lukranit [14]4 years ago
5 0
<span>The "is_ascending" variable allows for the programmer to denote if the list in question is in ascending order. If the list is in ascending order, then the variable "is_ascending" is considered true, and marked with variable as such. If the list is in descending order, in no discernible order, etc., the is_ascending variable does not apply, and is therefore false in reference to that list.</span>
dlinn [17]4 years ago
5 0
Is_ascending = True 
p = None 
for n in numbers: 
....if p is not None and n < p: 
........is_ascending = False 
........break 
....p = n 

This would also work 
is_ascending = True if numbers == sorted(numbers) else False 

In a real world scenario I would probably do this. 

def issorted(seq): 
....if not seq: return True 
....iseq = iter(seq) 
....prev = next(iseq) 
....for x in iseq: 
........if x < prev: 
............return False 
....return True


The answer the <span>is_ascending is False</span>
You might be interested in
HELPPPP Which point of view does this illustration represent?
vodomira [7]

Answer:

B.  Unions are harmful because they encourage violence

Explanation:

The poster shows groups of workers that look as if they are causing destruction and violence. With the figure on the right, it seems they are the ones to put out this violence, so you can say this poster is going against the creation of Unions.

7 0
3 years ago
Read 2 more answers
How did the tactics o fthe student protesters from the sncc differ from those of the boycotters in montgomery??
frosja888 [35]
SNCC or the Student Nonviolent Coordinating Committee, was more fierce and veered towards infringing upon the law. SNCC understudies (peaceful) utilized more angry approaches to dissent (sit-ins and flexibility rides). I hope the answer will help you. Feel free to ask more questions here at brainly.  

6 0
4 years ago
What happens to water that is not removed from land by evapotraspiration
11Alexandr11 [23.1K]
It'll eventually evaporate if the sun is out too long
6 0
3 years ago
How was Kennedy’s foreign policy characterized by aid and crises?
djverab [1.8K]

Answer:

Kennedy tend to prefers peaceful approach to end foreign crisis rather than using military confrontation

Explanation:

Example of this would be when he solved the Cuban missile crisis. Rather than choosing a military approach, he opted to persuade Cuban government through economic agreements and various other types of foreign aid. In the end, Cuba cut down its relation with soviet union's missile project and end the crisis peacefully.

7 0
3 years ago
When was the Revolutionary war?
Mkey [24]
It started in April 19, 1775, and ended in s<span>eptember 3, 1783.</span>
8 0
3 years ago
Read 2 more answers
Other questions:
  • When was the Trojan horse built?
    11·1 answer
  • Non-example of republicanism
    5·2 answers
  • How did the timing of General Washington’s attack on Trenton help ensure a colonial victory?
    14·2 answers
  • Why did the Nazi Party appeal to so many German youth?
    12·2 answers
  • During his second term, which problem did George W. Bush attempt to address by calling for the privatization of Social Security?
    10·2 answers
  • Which troops entered Berlin first at the close of the war?
    14·2 answers
  • Which word group is a complete sentence​
    15·2 answers
  • What features of colonial politics in 18th century America contributed to the development of popular democracy, and what kept po
    10·1 answer
  • We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain una
    7·1 answer
  • Explain Georgia's response to the ruling of Brown v. Board of Education.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!