Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Digits increasing
#2
Is there some reason this has to be done recursively? It does not strike me as a program well suited for recursion, certainly not in Python. It would be far to easy to hit the recursion limit.

I would just have a function that checks for increasing digits. Then a simple loop where you increase n by one, check that for increasing digits, and then break and return if you have them. The same code with a function for decreasing digits solves the other side of the problem.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Digits increasing - by meknowsnothing - Feb-16-2019, 06:09 PM
RE: Digits increasing - by ichabod801 - Feb-16-2019, 07:39 PM
RE: Digits increasing - by meknowsnothing - Feb-16-2019, 08:28 PM
RE: Digits increasing - by scidam - Feb-17-2019, 07:26 AM
RE: Digits increasing - by meknowsnothing - Feb-17-2019, 08:39 AM
RE: Digits increasing - by meknowsnothing - Feb-17-2019, 10:19 AM
RE: Digits increasing - by scidam - Feb-17-2019, 11:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Increasing difficulty of a maths game Maxxy_Gray 1 3,205 Apr-04-2018, 03:00 PM
Last Post: sparkz_alot
  Increasing depth in python malling 19 14,156 Oct-20-2016, 10:43 PM
Last Post: malling

Forum Jump:

User Panel Messages

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