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
Motor oil is responsible for
Lelechka [254]

Answer:

lubricating all moving parts in the engine

Explanation:

like the pistons, pushrods, and the crank

5 0
3 years ago
Engineers create a new metal that is stronger than steel but much lighter. This material is also significantly cheaper than what
zysi [14]

The best step for the engineers to make next is option D. Begin to design an airplane using this metal.

<h3>What is the metallic is plane parts?</h3>

Aluminum and its alloys are nevertheless very famous uncooked substances for the production of business planes, because of their excessive electricity at exceedingly low density. Currently, excessive-electricity alloy 7075, which includes copper, magnesium and zinc, is the only used predominantly withinside the plane industry.

The solution is D, due to the fact even as it's far crucial to marketplace the fabric and ensure humans are inquisitive about buying, they first want to attempt to layout aircraft the usage of this fabric. There isn't anyt any use promoting an aircraft constituted of this material_ if a aircraft can not be built.

Read more about the aircraft:

brainly.com/question/5055463

#SPJ1

7 0
2 years ago
Explain how feedback control is used to<br> adjust robotic movements.
LuckyWell [14K]

Answer:

Feedback control of arm movements using Neuro-Muscular Electrical Stimulation (NMES) combined with a lockable, passive exoskeleton for gravity compensation

6 0
2 years ago
A house is losing heat at a rate of 1700 kJ/h per °C temperature difference between the indoor and the outdoor temperatures. Exp
Furkat [3]

Answer:

1700kJ/h.K

944.4kJ/h.R

944.4kJ/h.°F

Explanation:

Conversions for different temperature units are below:

1K = 1°C + 273K

1R = T(K) * 1.8

= (1°C + 273) * 1.8

1°F = (1°C * 1.8) + 32

Q/delta T = 1700kJ/h.°C

T (K) = 1700kJ/h.°C

= 1700kJ/K

T (R) = 1700kJ/h.°C

= 1700kJ/h.°C * 1°C/1.8R

= 944.4kJ/h.R

T (°F) = 1700kJ/h.°C

= 1700kJ/h.°C * 1°C/1.8°F

= 944.4kJ/h.°F

Note that arithmetic operations like subtraction and addition of values do not change or affect the value of a change in temperature (delta T) hence, the arithmetic operations are not reflected in the conversion. Illustration: 5°C - 3°C

= 2°C

(273+5) - (273+3)

= 2 K

5 0
3 years ago
​Write 83,120 in expanded form using powers of 10.
maksim [4K]

Answer:

8*10000+3*1000+1*00+2*10+2

Explanation:

8 0
2 years ago
Other questions:
  • To cool a summer home without using a vapor compression refrigeration cycle, air is routed through a plastic pipe (k=0.15 W/m*K,
    15·1 answer
  • 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
  • Consider a process in which a carbon-based fuel is combusted in the presence of 70% excess oxygen (assume that all of the oxygen
    10·1 answer
  • What steps would you take to design an improved toothpaste container?
    12·1 answer
  • For the same cross-sectional area, which column provides the higher buckling load: a circular bar or a circular tube?
    15·1 answer
  • How do Consumers sometimes interact with a producers?
    13·1 answer
  • Engine blocks are made by using a manufacturing process called​
    12·1 answer
  • The speed of sound in a fluid can be calculated using the following equation:
    6·1 answer
  • Travel Planning or Destination Planning will help make your travel more efficient, and not necessary a risk reduction plan as yo
    10·2 answers
  • The results of a _________ test will determine if there is suitable drainage and the size of the drain field that will be requir
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!