Python Forum
computing average in nested loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
computing average in nested loops
#3
sum(weighted) = 1. The value of
    for num in weighted:
        score = float(input('Enter scores: ')) * num
        total += score
        total /= sum(weighted)
        total2 += total
        total2 /= len(students)
is what I am trying to use. Since sum(weighted) = 1, does it affect the value of total?
Reply


Messages In This Thread
computing average in nested loops - by cap510 - Sep-11-2020, 01:07 AM
RE: computing average in nested loops - by cap510 - Sep-11-2020, 03:42 AM
RE: computing average in nested loops - by buran - Sep-11-2020, 07:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem with nested loops robert5502001 7 3,678 Aug-01-2022, 06:26 AM
Last Post: stevensanders
  Capitalize first letter of names in nested loops student_of_python 9 4,844 Oct-27-2019, 07:51 AM
Last Post: Larz60+
  nested for loops to recursion ashkea26 4 3,558 Nov-02-2018, 05:00 PM
Last Post: ichabod801
  Computing average vestkok 2 2,552 Aug-12-2018, 10:02 AM
Last Post: vestkok
  Nested loops in openCV JimmyJangle 1 4,863 Apr-17-2018, 04:10 AM
Last Post: Mekire
  Computing factorials Truman 6 4,162 Mar-14-2018, 06:38 AM
Last Post: DeaD_EyE
  Nested for loops with numbers Liquid_Ocelot 7 5,949 Aug-15-2017, 06:38 AM
Last Post: nilamo
  computing the factorial of N foolsgold27 12 8,222 Aug-02-2017, 02:29 AM
Last Post: nilamo
  Nested loops, lists and if statements Liquid_Ocelot 10 9,093 Apr-23-2017, 02:02 PM
Last Post: Mekire

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020