Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtisQ&A DiscussƵes
I need to design a recursive function called replicate recurĀ which will receive two arguments:Ā timesĀ which is the number of times to repeat and dataĀ which is theĀ number or stringĀ to be repeated.
The function should return an array containing repetitions of the data argument.
For instance,Ā replicate_recur (3, 5)Ā should return [5,5,5].
If the timesĀ argument is negative or zero, return an empty array. If the argument is invalid,Ā raise ValueError.
0 Voto
4 RespostasIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
1 Voto
2 Respostaschallege
-1 Voto
1 RespostaQuente hoje
Roblox full version
1 Votes
Help me
1 Votes
Html code
1 Votes
What should I learn?
1 Votes
Help!
1 Votes
Ai and coding !!?
2 Votes
Help with c++ code
1 Votes