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
The articles of confederation represented the distrust of whom?
creativ13 [48]
A king (strong federal government) as the colonies had just broken away from England
6 0
3 years ago
How did Nelson Mandela expand his anti-government activities in the 1960s?
lesya692 [45]

Answer: its BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB

Explanation:

8 0
3 years ago
No one who was lazy or tried to live by the work of others was tolerated; everyone had to work. Thus on certain days each lord w
Grace [21]
I’m pretty sure one of the answers is the first option (The Inca were a self sufficient and hardworking group of people), as the text states, “No one who was lazy or tried to live by the work of others was tolerated; everyone had to work”.

The other answer might be the fourth option (The Inca government provided for its people during times of need), as it says in the text, “and if he was ill, he received what he needed from the storehouses)
7 0
3 years ago
Which place is home of the first known writtien code<br> Egypt<br> Mesopotamia <br> Both<br> Neither
dexar [7]

Answer:

Babylon

Explanation:

Hammurabi Biography. Hammurabi, the ruler of Babylon, is best known for the development of a code of laws known as the Code of Hammurabi, which was used to regulate Mesopotamian society.

5 0
3 years ago
Read 2 more answers
Please Help ME ASAP
Lana71 [14]
It’s letter c for the answer of this question
7 0
4 years ago
Other questions:
  • Please answer this question
    13·1 answer
  • What issue did Stephen A. Douglas believe had a constitutional basis for its resolution?
    11·2 answers
  • How was the immigrant experience In South Carolina different than in the rest of the United States?​
    14·1 answer
  • How did Congress react to the Black Codes of the 1860s?
    9·2 answers
  • PLEASE QUICK!!!
    12·1 answer
  • Europeans who participated in the scientific revolution placed value on knowledge that was acquired through what?
    13·1 answer
  • The Red Sticks were a group of Creek who __________.
    10·2 answers
  • What was the turning point of the battle of Gettysburg?
    13·2 answers
  • What did the 5,000 men involved with the civilian conservation corps (ccc) mainly focus on in Oklahoma
    6·2 answers
  • Which idea from the Enlightenment was used in the Declaration of Independence?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!