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
bezimeni [28]
2 years ago
6

A list is sorted in ascending order if it is empty or each item except the last one is less than or equal to its successor. HERE

S THE CODE:
def isSorted(input_list):
if len(input_list)==0 or len(input_list)==1:
return True
else:
for i in range(len(input_list)):
for j in range(i, len(input_list)):
if input_list[j] < input_list[i]:
return False
return True

def main():
lyst = []
print(isSorted(lyst))
lyst = [1]
print(isSorted(lyst))
lyst = list(range(10))
print(isSorted(lyst))
lyst[9] = 3
print(isSorted(lyst))


if __name__ == "__main__":
main()
Engineering
1 answer:
Free_Kalibri [48]2 years ago
7 0

Using the knowledge of computational language in python it is possible to write a code that writes a list and defines the arrange.

<h3>Writing code in python:</h3>

<em>def isSorted(lyst):</em>

<em>if len(lyst) >= 0 and len(lyst) < 2:</em>

<em>return True</em>

<em>else:</em>

<em>for i in range(len(lyst)-1):</em>

<em>if lyst[i] > lyst[i+1]:</em>

<em>return False</em>

<em>return True</em>

<em>def main():</em>

<em>lyst = []</em>

<em>print(isSorted(lyst))</em>

<em>lyst = [1]</em>

<em>print(isSorted(lyst))</em>

<em>lyst = list(range(10))</em>

<em>print(isSorted(lyst))</em>

<em>lyst[9] = 3</em>

<em>print(isSorted(lyst))</em>

<em>main()</em>

See more about python at brainly.com/question/18502436

#SPJ1

You might be interested in
Calculate how large a mass would be necessary to obtain a mechanical noise limit of [Equation] = 1 nG, 1 µG, and 1 mG if the mec
olga55 [171]

Answer:

Mechanical resonance frequency is the frequency of a system to react sharply when the frequency of oscillation is equal to its resonant frequency (natural frequency).

The physical dimension of the silicon is 10kg

Explanation:

Using the formular, Force, F = 1/2π√k/m

At resonance, spring constant, k = mw² ( where w = 2πf), when spring constant, k = centripetal force ( F = mw²r).

Hence, F = 1/2π√mw²/m = f ( f = frequency)

∴ f = F = mg, taking g = 9.8 m/s²

100 Hz = 9.8 m/s² X m

m = 100/9.8 = 10.2kg

6 0
2 years ago
What are the 5 major forest types?
Nataly [62]

Answer:

1. Equatorial Evergreen or Rainforest

2. Tropical forest

3. Mediterranean forest

4. Temperate broad-leaved forest

5. Warm temperate forest

Explanation:

4 0
3 years ago
Read 2 more answers
If a vacuum gau ge reads 9.62 psi, it means that: a. the very highest column of mercury it could support would be 19.58 inches.
scZoUnD [109]

Answer:All of the above

Explanation:

9.62 psi means 497.49 mm of Hg pressure

for (a)19.58 inches is equals to 497.49 mm of Hg

(b)atmospheric pressure is 14.69 psi

vaccum gauge is 9.62psi

absolute pressure is=14.69-9.62=5.07

(c)vaccum means air is sucked and there is negative pressure so it tells about below atmospheric pressure.

thus all are correct

8 0
3 years ago
The term variation describes the degree to which an object or idea differs from others of the same type or from a standard.
AfilCa [17]
The answer is true. Thank me later<3
5 0
2 years ago
Read 2 more answers
What are the three most common types of relearn procedures?
WITCHER [35]

Answer:

The three types of relearn procedures are auto relearn, stationary and OBD.

Explanation:

In TPMS system, after the direct service like adjustment of air pressure, tire rotation or replacement of sensors etc, is performed then maximum vehicle  often needs TPMS system relearn that needs to be performed.

For performing these relearn procedure, there are mainly three types:

  1. auto relearn
  2. stationary relearn
  3. OBD

After applying the relearn process, the TPMS system will again be in proper function.

8 0
3 years ago
Other questions:
  • A roller-coaster car is traveling at a speed of 23 m/s when it passes through point B. At that point, it enters a concave down c
    8·1 answer
  • 12. Dies are turned using a special tool called a/an
    10·1 answer
  • Holmes owns two suits: one black and one tweed. He always wears either a tweed suit or sandals. Whenever he wears his tweed suit
    14·1 answer
  • I'm really bad at measurements so I don't understand this.
    12·1 answer
  • If you are in a tornado situation, which of the following actions would put you in danger?
    11·1 answer
  • A(n) ____ is an exact representation of an object projected onto a plane from a specific position.
    14·1 answer
  • 1. You are asked to write a report about one of the structures that Transportation Engineers
    9·1 answer
  • Select the correct answer <br><br> What is the simplest definition of a manufacturing process?
    5·2 answers
  • Explain race condition..<br><br>don't spam..​
    13·2 answers
  • 9. What power tool incorporates a set of dies and punches to cut new
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!