Python Forum
Print name N times using recursion
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print name N times using recursion
#2
Not sure why you are calling func() inside the function, but this worked for me:

def func():
    for i in range(5):
        print ("Hello")

func()
Maybe your IDE is detecting an infinite loop? Your current code will cause a stack overflow.
Reply


Messages In This Thread
Print name N times using recursion - by ift38375 - Oct-23-2019, 05:11 AM
RE: Print name N times using recursion - by SouthernYankee - Oct-23-2019, 05:31 AM
RE: Print name N times using recursion - by buran - Oct-23-2019, 05:34 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Recursion and permutations: print all permutations filling a list of length N SantiagoPB 6 3,494 Apr-09-2021, 12:36 PM
Last Post: GOTO10
  GCF function w recursion and helper function(how do i fix this Recursion Error) hhydration 3 2,647 Oct-05-2020, 07:47 PM
Last Post: deanhystad
  Find how many times a user played an artist and how many times disruptfwd8 1 2,675 May-04-2018, 08:32 AM
Last Post: killerrex

Forum Jump:

User Panel Messages

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