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
An object of mass 521 kg, initially having a velocity of 90 m/s, decelerates to a final velocity of 14 m/s. What is the change i
Harman [31]

Answer:2058.992KJ

Explanation:

Given data

Mass of object\left ( m\right )=521kg

initial velocity\left ( v_0\right )=90m/s

Final velocity\left ( v\right )=14m/s

kinetic energy of body is given by=\frac{1}{2}mv^{2}

change in kinectic energy is given by substracting  final kinetic energy from initial kinetic energy of body.

Change in kinetic energy=\frac{1}{2}\times m\left ( V_0^{2}-V^2\right )

Change in kinetic energy=\frac{1}{2}\times521\left ( 90^{2}-14^2\right )

Change in kinetic energy=2058.992KJ

7 0
3 years ago
How do engineering approach their work (how do they do to solve the problem).
Romashka-Z-Leto [24]

engineering approach their work by finding new solutions to their problems. like if two things dont go together in an invention, they will find another way

6 0
3 years ago
What are the indicators of ineffective systems engineering?
liberstina [14]

Answer:

Indicators for ineffective system engineering are as follows

1.Requirement trends

2.System definition change backlog trends

3.interface trends

4.Requirement validation trends

5.Requirement verification trends

6.Work product approval trends

7.Review action closure trends

8.Risk exposure trends

9.Risk handling trends

10.Technology maturity trends

11.Technical measurement trends

12.System engineering skills trends

13.Process compliance trends

7 0
3 years ago
Risks can be changed.<br> True<br> False
Mrrafil [7]

Answer:

true

Explanation:

8 0
2 years ago
Which of the following is/are FALSE about refining aluminum from the ore state (mark all that apply) a)- A blast furnace is used
Anastasy [175]

Answer:

The options a)- A blast furnace is used and d)-Coke is used to produce the heat are FALSE.

Explanation:

Aluminium is a chemical element and the most abundant metal present in the Earth's crust. An aluminium ore is called bauxite. Aluminium is extracted from its ore by the process of electrolysis, called the Hall–Héroult process. The extraction of aluminium is an expensive process as it requires large amount of electricity. The bauxite is purified to produce aluminium oxide. Then, aluminium is extracted from the aluminium oxide.

<u>Therefore, the refining of aluminum from its ore does not involve the use of a blast furnace and coke to produce heat.</u>

<u />

8 0
3 years ago
Other questions:
  • 1. Calculate the battery life in years when a pacemaker has the following characteristics: Battery Ampere-hours = 1.5 Pulse volt
    15·1 answer
  • Which of the following are all desirable properties of a hydraulic fluid? a. good heat transfer capability, low viscosity, high
    5·1 answer
  • Technician A says that thrust angle refers to the direction the front wheels are pointing. Technician B says that scrub radius r
    11·1 answer
  • A ____ is marked by two sets of double yellow lines, with each set having a broken line on the inside, and a solid line on the o
    15·2 answers
  • Ti-6Al-4V has a fracture toughness of 74.6 MPa-m0.5. How much stress (in MPa) would it take to fail a plate loaded in tension th
    13·1 answer
  • How did studying pagodas help engineers create earthquake-proof structures in modern society?A. Engineers learned that the desig
    6·1 answer
  • What is a microwave transmitter?a) A technology that uses active or passive tags in the form of chips or smart labels that can s
    7·2 answers
  • An amplifier with 40 dB of small-signal, open-circuit voltage gain, an input resistance of 1 MO, and an output resistance of 100
    14·1 answer
  • 8. If you push a 2000 N weight up a ramp with 400 N of force and you raise the weight 1 meter,
    9·1 answer
  • 1. A cylindrical casting is 0.3 m in diameter and 0.5 m in length. Another casting has the same metal is rectangular in cross-se
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!