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
Schach [20]
2 years ago
13

Write the following function that returns True if the list is already sorted in increasing order:

Computers and Technology
1 answer:
miss Akunina [59]2 years ago
4 0

Answer:

# Get input and strip any leading/trailing spaces

inputList = input('Enter list: ').strip()

def issorted(lst):

   if len(lst) < 2:

       return True

   

   current = 1

   prev = 0

   while current < len(lst):

       # Compare if current value is less than the previous one

       if int(lst[current]) < int(lst[prev]):

           return False

       

       prev = current

       current += 1

   

   return True

# Convert input to list

inputList = inputList.split(' ')

# Print output

if issorted(inputList):

   print("The list is already sorted​")

else:

   print("The list is not sorted")

You might be interested in
RAM memory is intended?
adell [148]

Answer:

RAM is a short abbreviation for Random Access Memory. It is the physical working memory used by your PC to temporarily store computer data. Your PC stores all open applications, files, and any other data into RAM for quick access. The more RAM you have installed, the more programs you can run at the same time.

8 0
3 years ago
What is a biometric scanner?
Lisa [10]
<span>an electronic device used to determine a person's identity by detecting and matching the person's physical features, such as fingerprints or the eyes, to a database</span>
3 0
3 years ago
Read 2 more answers
When you open a program, the hard drive___
Papessa [141]

Answer:

When you open a program, the hard drive <u>Registers the program and runs the program accordingly. </u>

I hope this helped!

3 0
3 years ago
I was able to solve the question :))
Leviafan [203]

Answer:

ill take the points anyway

Explanation:

4 0
3 years ago
Does the wireless signal between the cell phones require matter to travel from one phone to another?
mrs_skeptik [129]

Mobile phones transmit and receive signals using electromagnetic waves, that is, wireless signal are electromagnetic waves which can travel through a vacuum, they do not need a medium or matter.

<h3>What are electromagnetic waves?</h3>

They are generated by electrical and magnetic particles moving at the same time (oscillating).

<h3>Characteristics of electromagnetic waves</h3>

  • Network waves are electromagnetic waves.

  • A mobile phone has coverage when it receives electromagnetic waves from at least one base station.

  • They do not necessarily require a material medium for their propagation.

Therefore, we can conclude that electromagnetic waves are those that do not need a material medium to propagate and include, among others, radio, television and telephone waves.

Learn more about electromagnetic waves here: brainly.com/question/13803241

3 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
  • What security protocol originally came with 802.11 equipment?
    11·1 answer
  • Which of the following menu commands would you select to make a copy of an open file and rename it?
    15·1 answer
  • A tower or mini tower pc is a type of all- in -one unit true or false
    9·2 answers
  • Emilio is reviewing the data he collected from historical records about immigration in the united states. He decides to create a
    5·1 answer
  • Which image shows organic shapes? <br> A. image 1 <br> B. image 2 <br> C. image 3 <br> D. image 4
    14·2 answers
  • A(n) ____ is a front-end processor that multiplexes the traffic from hundreds of remote terminals into one port on a large compu
    10·1 answer
  • What is a major way that a consumer can protect himself/herself when getting a credit card? A) Making sure that they get a very
    8·1 answer
  • )In a graph represented by adjacency matrix u can find all the neighbours of a given vertices in ____Operations
    6·1 answer
  • a 2x4 line decoder with enable is implemented using nand gate only. how many nand gate is needed to construct this line decoder?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!