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]
3 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]3 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
Need help with these 3 questions pls help
Anton [14]

Answer:

I think 5 is passion and 6 is true I think and 7 is time management I'm pretty sure

3 0
3 years ago
While walking across campus one windy day, an engineering student speculates about using an umbrella as a "sail" to propel a bic
makvit [3.9K]

Answer:

Given data:\\While walking across campus one windy day\\Frontal area, \(A=0.3 m ^{2}\)\\Wind speed \(V=24 Km / hr\)\\The drag coefficient \(C_{D, b}=1.2\)\\The combined mass \(m=75 kg\)\\Umbrella diameter, \(D=1.22 m\)\\Velocity of wind \(V=24 \frac{ km }{ hr }\)\\The rolling resistance \(C_{R}=0.75 \%\)

Solution:

Note: Refer the diagram

Basic equation:\\'s law of motion: \(\sum F_{x}=m a_{x}\)\\Lift coefficient, \(C_{L}=\frac{F_{L}}{\frac{1}{2} \rho V^{2} A_{p}}\)\\Drag coefficient, \(C_{D}=\frac{F_{D}}{\frac{1}{2} \rho V^{2} A_{p}}\)

From force balance equation:\\\(\sum F_{x}=F_{D}-F_{R}=0\)\\But \(F_{D}=\left(C_{D, \alpha} A_{u}+C_{D, B} A_{b}\right) \frac{1}{2} \rho\left(V_{\nu}-V_{b}\right)^{2}\)\(F_{R}=C_{R} m g\)\\Area of the Umbrella \(A_{u}=\frac{\pi D_{u}^{2}}{4}\)\(A_{x}=\frac{\pi \times 1.22^{2}}{4} m ^{2}\)\(A_{v}=1.17 m ^{2}\)

Drag coefficient data for selected objects table at

Hemisphere (open end facing flow), C_{D, x}=1.42

Substituting all parameters,

\begin{aligned}&F_{R}=0.0075 \times 75 \times 9.81\\&F_{R}=5.52 N\end{aligned}

Then,

\begin{aligned}&V_{b}=V_{w}-\left[\frac{2 F_{R}}{\rho\left(C_{D, w} A_{w}+C_{D, B} A_{b}\right)}\right]^{\frac{1}{2}} \dots\\&V_{w}=24 \times 1000 \times \frac{1}{3600}\\&V_{w}=6.67 \frac{ m }{ s }\end{aligned}

And the equation becomes,

\begin{aligned}&V_{b}=6.67-\left[\frac{2 \times 5.52}{1.23(1.42 \times 1.17+1.2 \times 0.3)}\right]^{\frac{1}{2}}\\&V_{b}=6.67-2.11\\&V_{b}=4.56 \frac{ m }{ s }\end{aligned}

Thus the floyds travels at 68.3^{\circ}wind speed.

7 0
4 years ago
Estimate the energy (head) loss a short length of a pipe conveying 300 litres of water per second and suddenly enlarging from a
Ludmilka [50]

Known :

Q = 300 L/s = 0.3 m³/s

D1 = 350 mm = 0.35 m

D2 = 700 mm = 0.7 m

g = 9.81 m/s²

Solution :

A1 = πD1² / 4 = π(0.35²) / 4 = 0.096 m²

A2 = πD2² / 4 = π(0.7²) / 4 = 0.385 m²

hL = (kL / 2g) • (U1² - U2²)

hL = (kL / 2g) • Q² (1/A1² - 1/A2²)

hL = (1 / 2(9.81)) • (0.3²) • (1/(0.096²) - 1/(0.385²))

hL = 0.467 m

5 0
3 years ago
A window‐mounted air‐conditioning unit (AC) removes energy by heat transfer from a room, and rejects energy by heat transfer to
Arada [10]

Solution :

Given :

The power of the air‐conditioning (AC) unit is , W = 0.434 kW

The coefficient of performance or the COP of the air‐conditioning (AC) unit is given by  = 6.22

Therefore he heat removed is given by , $Q_H = 6.22 \times 0.434$

                                                                     $Q_H = 2.7 \ kW $

Now if the electricity is valued at  0.10 dollar per kW hour, then the operating cost of the air conditioning unit in 24 hours is given by = 0.10 x 2.7 x 24

                                                                                            = 6.48

Therefore the operating cost = $ 6.48 for 24 hours.

3 0
3 years ago
How does heat conduction differ from convection?
Helga [31]

Explanation:

Conduction:

     Heat transfer in the conduction occurs due to movement of molecule or we can say that due to movement of electrons in the two end of same the body. Generally,  phenomenon of conduction happens in the case of solid . In conduction heat transfer takes places due to direct contact of two bodies.

Convection:

              In convection heat transfer of fluid takes place due to density difference .In simple words we can say that heat transfer occur due to motion of fluid.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Hi, any kind of help on these questions will be appreciated.
    10·1 answer
  • A 30 mm thick AISI 1020 steel plate is sandwiched between two 10 mm thick 2024-T3 aluminum plates and compressed with a bolt and
    9·1 answer
  • Technician A says that 18 gauge AWG wire can carry more current flow that 12 gauge AWG wire. Technician B says that metric wire
    9·1 answer
  • It is proposed to deposit a 5 μm thick nickel coating uniformly on all surfaces of a ceramic strip measuring 15 cm x 5 cm x 2 cm
    7·1 answer
  • In 1903, Aegidius Elling of Norway designed and built an 11-hp gas turbine that used steam injection between the combustion cham
    13·1 answer
  • Tamara has received multiple bids from general contractors to install a new pool in her backyard. How should she go about select
    5·1 answer
  • A piece of corroded steel plate was found in a submerged ocean vessel. It was estimated that the original area of the plate was
    14·1 answer
  • Nbcghjjfujymujgtfutyduyffuoyffff7t
    9·1 answer
  • Indentify the common types of conductors used for: a. Distribution lines (33kV and below) b. Transmission lines (66kV and above)
    10·1 answer
  • If you are being tailgated and need to make a stop, you should
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!