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
@souris_a_boule56958 ай бұрын
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
@danielcrompton78188 ай бұрын
Thank you!😊
@williamsquires30708 ай бұрын
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. 😊
@davidmurphy5638 ай бұрын
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!
@killerfc8 ай бұрын
🤣 me too
@Indently8 ай бұрын
It was a silly wordplay with the title, I hope you enjoyed the video though! :)
@davidmurphy5638 ай бұрын
@@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. :)
@danielcrompton78188 ай бұрын
@@Indentlyyes I get the joke now!!
@Russet_Mantle6 ай бұрын
7:51 the words you're looking for are "with replacement" (choice) and "without replacement" (sample) as in statistics lingo
@sovereignlivingsoul7 ай бұрын
good coding practices, that is what i like to learn, thanks for your input
@michaelhoffmann28918 ай бұрын
Addendum: do NOT use any of these for cryptographic, or even scientific, code! 😆
@tinahalder84167 ай бұрын
In ML to randomise data, these functions are used. For crypto there is secure module
@alboz13277 ай бұрын
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!
@yash11528 ай бұрын
8:48 shuffle vs sample can trip over many ppl many times ig
@Reojoker8 ай бұрын
Seed is also useful if you write software for research as it allows your results to be easily reproducible.
@69k_gold8 ай бұрын
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.jester54068 ай бұрын
No, if you want that you should use random.sample()
@sadhappy88608 ай бұрын
I knew about choices but sample would have been really helpful about a year ago
@paulosergioschlogl95508 ай бұрын
nice video. thanks
@dipeshsamrawat79578 ай бұрын
Nice! Keep it up. 💯
@danielcrompton78188 ай бұрын
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
@_HetShah_8 ай бұрын
Do you think there's a way to reverse engineer randomness using seed in some way?
@hindsighttt8 ай бұрын
im pretty sure there is but you gotta look at the code of the random library and do it that way
@DendrocnideMoroides8 ай бұрын
There definitely is, if you want a more secure version of the random library then use the secrets library in Python.
@katrinabryce8 ай бұрын
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.
@dbottesi8 ай бұрын
Another great video!! Thumbs 👍
@winTer_x647 ай бұрын
More flet tutorials plzzz
@Lets_code_together_8 ай бұрын
i have applied for coupoun code please provide me it is so much helpful for me
@Pawlo3708 ай бұрын
how to know seed?
@danielcrompton78188 ай бұрын
Make it up! It doesn’t matter what it is, just so long as it is consistent for the best results