Posts by Rafael Lima • 67 points
3 posts
-
0
votes1
answer244
viewsQ: How to keep a fixed value within a recursive function?
I would like to create a variable with the first value passed as parameter in a function, but every time a recursive call is made the variable receives the value of the new parameter passed. For…
-
3
votes3
answers2001
viewsQ: Recursive function with strings - Python
I’m having trouble solving an exercise. The statement is as follows: Implement the annoy(n) function that returns a string containing "annoy " (the word followed by a space) n times. If n is not a…
-
3
votes2
answers10535
viewsQ: How to separate the digits of an integer and add them together? - Python
How to separate the digits of a number and add them up, for example: 123 -> 1 + 2 + 3 = 6 How to do this, however, do this using arithmetic operators. I saw a case where it was separated using…