Python Forum
computing average in nested loops
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
computing average in nested loops
#5
@micseydel - they multiple by weight on the same line (12 or 2 in the different snippets they post) on which they take the input (num is actually respective weight). But of course you are right - they have weights in range (0-1) and sum of weights is 1, so there is no need to divide by 1. I was thinking to comment on this in the other thread but it slipped from my mind when posting an answer.

EDIT: I see your point now
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

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,729 Aug-01-2022, 06:26 AM
Last Post: stevensanders
  Capitalize first letter of names in nested loops student_of_python 9 4,909 Oct-27-2019, 07:51 AM
Last Post: Larz60+
  nested for loops to recursion ashkea26 4 3,575 Nov-02-2018, 05:00 PM
Last Post: ichabod801
  Computing average vestkok 2 2,573 Aug-12-2018, 10:02 AM
Last Post: vestkok
  Nested loops in openCV JimmyJangle 1 4,884 Apr-17-2018, 04:10 AM
Last Post: Mekire
  Computing factorials Truman 6 4,188 Mar-14-2018, 06:38 AM
Last Post: DeaD_EyE
  Nested for loops with numbers Liquid_Ocelot 7 6,009 Aug-15-2017, 06:38 AM
Last Post: nilamo
  computing the factorial of N foolsgold27 12 8,261 Aug-02-2017, 02:29 AM
Last Post: nilamo
  Nested loops, lists and if statements Liquid_Ocelot 10 9,153 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