Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sum of 1-100
#2
hi,

if you looks the first code, every time you iterate a new 'n' in 'r', it s added to 'x' and 'x' change after each iteration.
in the second one, for each iteration, you give a new value for 'y' which is the value of 'n' plus the value of 'x' and x=0.
I hope that will be helpful
Reply


Messages In This Thread
Sum of 1-100 - by ClassicalSoul - Mar-02-2019, 02:01 PM
RE: Sum of 1-100 - by Scorpio - Mar-02-2019, 02:15 PM
RE: Sum of 1-100 - by perfringo - Mar-02-2019, 05:17 PM

Forum Jump:

User Panel Messages

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