day-5-1-exercise

Not run yet
This repl has no cover image
Details
Created on Oct 28, 2020
This repl has no description
2 Reactions
10comments
to comment
ninjahanderson1 week ago
🚨 Don't change the code below 👇

student_heights = input("Input a list of student heights ").split()for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n])

🚨 Don't change the code above 👆

#Write your code below this row 👇

cum_sum = 0

for height in student_heights:

cum_sum += height

average_height = round(cum_sum / len(student_heights))

print(average_height)

aminfazl13721 week ago

height=input("Input student heights: ")

h=height.split()

j=0

s=0

for i in h:

s+=int(i)

j+=1

print(f"Average:{round(s/j)}")

tjanhvi5602 weeks ago

student_heights = [180, 124, 165, 173, 189, 169, 146]

total_height=0

for h in range(0,len(student_heights)):

  total_height += student_heights[h]

print(f"Total height = {total_height}")

number_of_students=0

number_of_students = int(len(student_heights))

print(f"Number of students = {number_of_students}")

average_height = round(total_height / number_of_students)

print(f"The average height among all the student's height = {average_height}")

obgyneKenobi213 weeks ago

Average = 0

student_heights = input("Input a list of student heights ").split()for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n])

Average += student_heights[n] / len(student_heights)

print("Total Average: " , round(Average, 2))

rachid883 weeks ago

sum_hights=0

nbr_candidats = 0

for height in student_heights:

sum_hights += height

nbr_candidats += 1

if nbr_candidats != 0 :

avg_hight = round(sum_hights/nbr_candidats)

print(f"the average hight of this sample is {avg_hight}")

DenM763 weeks ago

count = 0sum_of_heights = 0

for height in student_heights: sum_of_heights += height count += 1

print(round(sum_of_heights/count))

Eldaube4 weeks ago

eight_sum = 0student_nb = 0

if not student_heights: print("We need a input to work with!")else:

for heights in student_heights: student_nb += 1 height_sum += heights

height_average = round(height_sum / student_nb, 0)

print(f"The total height is {height_sum}.") print(f"There are {student_nb} students.") print(f"The average height is {height_average}.")

AnastasiiaVysh1 month ago
🚨 Don't change the code below 👇

student_heights = input("Input a list of student heights ").split()for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n])

🚨 Don't change the code above 👆

#Write your code below this row 👇sum_student_heights = 0quantity_std = 0

for t in student_heights: sum_student_heights += t quantity_std += 1

average_height = round(sum_student_heights / quantity_std)print(average_height)

OR

🚨 Don't change the code below 👇

student_heights = input("Input a list of student heights ").split()for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n])

🚨 Don't change the code above 👆

average_height = sum(student_heights) / len(student_heights)print(round(average_height)

FrozenChicken1 month ago

totally i do not understand

ZeroOne41 month ago
# 🚨 Don't change the code below 👇
student_heights = input("Input a list of student heights ").split()
for n in range(0, len(student_heights)):
  student_heights[n] = int(student_heights[n])
# 🚨 Don't change the code above 👆


#Write your code below this row 👇
student_heights_total = 0
student_count = 0
for i in student_heights:
    student_heights_total += i
    student_count +=1

average_height = round(student_heights_total / student_count)

print(average_height)
Forks
day-5-1-exercise
day-5-1-exercise
day-5-1-exercise
day-5-1-exercise-3
day-5-1-exercise-1