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
Sedaia [141]
3 years ago
15

Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine

the number of students not currently standing in their correct positions.Students in a class are asked to stand in ascending order according to their heights for the annual class photograph. Determine the number of students not currently standing in their correct positions.
Mathematics
1 answer:
horrorfan [7]3 years ago
4 0

Answer:

The function in Python is as follows:

def heightChecker(heights):

   expected = []

   count = 0

   for i in range(len(heights)):

       expected.append(heights[i])      

   expected.sort()

   for i in range(len(heights)):

       if expected[i] != heights[i]:

           count+=1  

   return count

Step-by-step explanation:

Required

Function to return the number of out of position students

<em>See comment for complete question</em>

This defines the function. It receives the heights as a parameter, from the main

def heightChecker(heights):

This initializes a list, (expected list)

   expected = []

This initializes the count of out of position students

   count = 0

This iterates through the original list

   for i in range(len(heights)):

The list item is then appended to the expected list

       expected.append(heights[i])      

This sorts the expected list in ascending order

   expected.sort()

This iterates through the original and the expected lists

   for i in range(len(heights)):

If list elements at the same index are not the same, count is incremented by 1

<em>        if expected[i] != heights[i]: </em>

<em>            count+=1  </em>

This returns count

   return count

You might be interested in
Help me plss need help with theses three
fiasKO [112]
interior angle of a regular 18-gon.
It is easier to calculate the exterior angle of a regular polygon of n-sides (n-gon) by the relation
exterior angle = 360/n
For a 18-gon, n=18, so exterior angle = 360/18=20 &deg;
The value of each interior angle is therefore the supplement, or
Interior angle = 180-20=160 degrees.

Naming of a 9-gon
A polygon with 9 vertices is called a nonagon (in English) or enneagon (French ennéagone, but the English version is sometimes used)
You had a good start with the correct answer.

Exterior angle of a 15-gon
The exterior angle of a 15-gon can be calculated using the relation given in the first paragraph, namely
Exterior angle = 360/15=24 degrees
4 0
3 years ago
Solve the equation. Round to the nearest thousandth. -12e-x + 8 = 7​
Marysya12 [62]

Answer:

-12e-x + 8 = 7

-12e-x = 7-8

-12e-x = -1

12e-x = 1

e-x = 1/12

ln(e-x) = ln(1/12)

x = -ln(1/12)

x = -2.485

7 0
3 years ago
...determina las distintas posibilidades que tiene un agricultor al sembrar 115 arboles en filas de igual numero de arboles ...
Vedmedyk [2.9K]
23 lines × 5 trees= 115 tree. or. 5 lines × 23 trees = 115 trees
5 0
3 years ago
A practice field is 350 feet long. The game field is 40% longer than the practice field. How long is the game field?
kifflom [539]

Answer: 490 feet

Step-by-step explanation: Since the game field is 40% longer than the practice field, it is 140% or 1.4 times the practice field. 350•1.4 is 490 feet.

8 0
2 years ago
I just need to know is anyone would follow my tiktok, low-key just tryna get to 5,000.
Harman [31]

Answer:

ok

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • A package of breadcrumbs to feed the ducks at the duck pond costs $0.25. How many packages of bread crumbs could be bought with
    5·2 answers
  • The water level in a pool drops 4 1/4 inches. What rational number represents a drop of 4 1/4 inches?
    11·2 answers
  • If h()=² and () =h() +, what is the value of ?
    13·1 answer
  • Please please please help me with this answer and how you got it
    10·1 answer
  • Can someone please help me
    11·1 answer
  • I NEED ANSWERS ASAP(WORTH 20 POINTS) WILL MARK BRAINLIEST
    9·2 answers
  • Which function has a greater slope​
    13·1 answer
  • Food A contains 150 calories in 3/4of a serving. Food B contains
    6·2 answers
  • To divide the following equation how would we revise the problem? 7.82 divided by .25
    12·1 answer
  • The right triangle below is dilated by a scale factor of 3. Find the perimeter and area
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!