Python Forum
minor mistake in code for factorial
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
minor mistake in code for factorial
#2
Remember that when a return statement is encountered, the function immediately returns. So, only one iteration of your while loop is performed, because the function returns at the end of that.
Reply


Messages In This Thread
RE: minor mistake in code for factorial - by ndc85430 - Aug-22-2020, 04:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Solved] Please, help me find a simple mistake AlekseyPython 2 1,794 Jun-17-2021, 12:20 PM
Last Post: AlekseyPython
  [split] Could you please clarify where i did mistake also how run without admin right Abubakkar 1 1,819 Jun-14-2021, 09:32 AM
Last Post: Larz60+
  Please help to me to find my mistake in code leonardin 2 1,897 Nov-29-2020, 04:17 PM
Last Post: Larz60+
  Comparing recursion and loops using two scripts (basic factorial) Drone4four 3 2,299 Oct-11-2020, 06:48 PM
Last Post: deanhystad
  Python factorial code timebrahimy 4 75,929 Sep-27-2020, 12:23 AM
Last Post: timebrahimy
  factorial, repeating Aldiyar 4 2,860 Sep-01-2020, 05:22 PM
Last Post: DPaul
  factorial using recursive function spalisetty06 12 4,185 Aug-25-2020, 03:16 PM
Last Post: spalisetty06
  Simple mistake about for Nomatter 4 2,336 Jul-16-2020, 02:24 PM
Last Post: Nomatter
  Factorial Code is not working when the given number is very long integer Raj_Kumar 2 2,361 Mar-31-2020, 06:40 PM
Last Post: deanhystad
  Install Mistake jlerette5 1 1,938 Feb-18-2020, 12:19 AM
Last Post: jefsummers

Forum Jump:

User Panel Messages

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