Python Forum
Formula function (not too difficult i think)
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Formula function (not too difficult i think)
#6
...... Doh Doh Doh
def func(year):
    x = 100; y = 5
    if year == 1: return x
    return (func(year-1))*y+x

for i in range(1, 5):
    print(func(i))
Output:
100 600 3100 15600
Reply


Messages In This Thread
RE: Formula function (not too difficult i think) - by naughtyCat - Aug-27-2021, 03:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculating of difficult integrals in python enitorc 0 5,555 Apr-15-2018, 01:24 PM
Last Post: enitorc

Forum Jump:

User Panel Messages

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