Hint: if you need a list of unique random integers, you combine the list comprehension that generates an ordered list from (x,y), and then call shuffle() on it, where x < y and are integers. 😊
@basurigos9 ай бұрын
Hey man, your videos are amazing, could you please make a video about how the built in functions work under the hood, like how does __import__ or __build_class__ work, i know those are do not touch functions, but I'm curious
@Russet_Mantle7 ай бұрын
7:51 the words you're looking for are "with replacement" (choice) and "without replacement" (sample) as in statistics lingo
@souris_a_boule56959 ай бұрын
Something that can be interesting is to use the Random class from this module. It provide exact same functions as method but each instance have its own seed and and are not shared with the global seed. So for example you can use this in a class that have random behavior where each instances have their own seed and each random function call will not affect another instance
@danielcrompton78189 ай бұрын
Thank you!😊
@davidmurphy5639 ай бұрын
Ok, I was into the third function before the penny dropped and I twigged you were covering the `import random` module and not just going through random functions!
@killerfc9 ай бұрын
🤣 me too
@Indently9 ай бұрын
It was a silly wordplay with the title, I hope you enjoyed the video though! :)
@davidmurphy5639 ай бұрын
@@Indently Yeah, it was good! I like your vids. Well, I knew it already but, I'm sure many don't and I watch just in case. :)
@danielcrompton78189 ай бұрын
@@Indentlyyes I get the joke now!!
@sovereignlivingsoul8 ай бұрын
good coding practices, that is what i like to learn, thanks for your input
@dipeshsamrawat79579 ай бұрын
Nice! Keep it up. 💯
@69k_gold9 ай бұрын
Does choices() always guarantee that we won't get the element at the same index twice if we call it with a number less than len(list)
@k.r.jester54069 ай бұрын
No, if you want that you should use random.sample()
@yash11529 ай бұрын
8:48 shuffle vs sample can trip over many ppl many times ig
@_HetShah_9 ай бұрын
Do you think there's a way to reverse engineer randomness using seed in some way?
@hindsighttt9 ай бұрын
im pretty sure there is but you gotta look at the code of the random library and do it that way
@DendrocnideMoroides9 ай бұрын
There definitely is, if you want a more secure version of the random library then use the secrets library in Python.
@katrinabryce9 ай бұрын
Yes, and a lot of security work goes in to making sure people aren't able to do that. Cloudflare for example use a bunch of lava lamps to generate their random seed.
@Reojoker9 ай бұрын
Seed is also useful if you write software for research as it allows your results to be easily reproducible.
@paulosergioschlogl95509 ай бұрын
nice video. thanks
@dbottesi9 ай бұрын
Another great video!! Thumbs 👍
@danielcrompton78189 ай бұрын
Hey, will you make any more iOS videos, that is actually how I found your channel!!! I also program in Python so your videos are still really interesting
@sadhappy88609 ай бұрын
I knew about choices but sample would have been really helpful about a year ago
@Pawlo3709 ай бұрын
how to know seed?
@danielcrompton78189 ай бұрын
Make it up! It doesn’t matter what it is, just so long as it is consistent for the best results
@winTer_x649 ай бұрын
More flet tutorials plzzz
@michaelhoffmann28919 ай бұрын
Addendum: do NOT use any of these for cryptographic, or even scientific, code! 😆
@tinahalder84168 ай бұрын
In ML to randomise data, these functions are used. For crypto there is secure module
@alboz13278 ай бұрын
Why wouldn't I use these for sci programming... I can always specify a seed anyway, to make experiments testable. I would be interested if you wanted to give more insights into what you are saying, thanks!
@Lets_code_together_9 ай бұрын
i have applied for coupoun code please provide me it is so much helpful for me