Dyskusje Q&A
Import random
0 głosów
16 odpowiedziUnfair challenges
2 głosów
4 odpowiedziFor challengers
1 Głos
4 odpowiedziQuiz with loop from 0 to 100
0 głosów
8 odpowiedziLoop repeating program
0 głosów
3 odpowiedziUnity animation bugs
1 Głos
1 Odpowiedź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 głosów
4 odpowiedzi
so although using srand(time(0)) can be used to get truly random numbers, how truly random are they? For example, if one were to call this method at the same time (in this example, if one were to use this command at 51s) each time would the numbers generated be the same???
If so, are the numbers still truly random??
And if this theory is true, how can one generate truly random numbers that cannot repeat based on external variables (e.g., time)?
2 głosów
4 odpowiedziPopularne dzisiaj
Loops and conditions
2 Votes
GitHub account connecting issue
3 Votes
photo upload issue in html code
0 Votes
Coding issue
2 Votes
app for lessons
1 Votes
Alguém Português por aqui?
0 Votes
Any coding competitions?
1 Votes