Why Is "random.seed()" So Important In Python?

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 30

  • @Indently
    @Indently  Год назад +15

    It slipped my mind at the time of recording, but seeds are not generated randomly, they are generated from your system time (simply put).

  • @MUTHU_KRISHNAN_K
    @MUTHU_KRISHNAN_K Месяц назад +1

    Thank you very much sir.
    Short and crisp explanation 🫡

  • @thiagowilliam5488
    @thiagowilliam5488 Год назад +7

    A huge thank you. You finally explained to me what the seed() is. I wasn't able to understand until I watch your video, it really made sense to me. Thank you!!

  • @Anonymous-v4g
    @Anonymous-v4g Год назад +3

    This video helped me to create a full guide on the random module, so thank you so much Indently :)

  • @user-ks1zu8jt4u
    @user-ks1zu8jt4u Год назад +1

    thanks a lot! I couldn't find any good explanation, but yours the best

  • @MayankSrivastava12655
    @MayankSrivastava12655 10 месяцев назад

    Really Great and Simple Explanation. Thank you for making such a specific explanation video.

  • @dbstudio7859
    @dbstudio7859 Год назад +1

    You have really good and high-quality videos keep shooting

  • @eshaankushwaha6474
    @eshaankushwaha6474 Год назад

    well you explained this in 2 mins straight good work!

  • @krishwanthkishore8299
    @krishwanthkishore8299 4 месяца назад

    Superb explanation 👌

  • @yabool2001
    @yabool2001 Год назад +1

    Great!

  • @guru_bro
    @guru_bro Год назад

    Thank u very much. God bless u.

  • @di-egohumilde4515
    @di-egohumilde4515 19 дней назад

    Is it a best practice to use it?
    Or is it just depending on your project?

  • @Anton-kn2yn
    @Anton-kn2yn Год назад +1

    thank you for this🙏

  • @AstronomyAstropy
    @AstronomyAstropy Год назад

    Hi Indently, can you make tutorial about Kivy App development for Android I didn't find good tutorial maybe your make Great tutorial because I always watch your lessons and learn good things you're best python programmer and RUclipsr

  • @Henry-tong
    @Henry-tong 8 месяцев назад +1

    I am wondering, what is the difference for different number in seed

    • @di-egohumilde4515
      @di-egohumilde4515 19 дней назад +1

      There is no difference, once you have created your numbers with that seed then they will stay the same for that seed, if you change seed it will generate new random numbers but if you go back to the previous seed it will generate the last random numbers
      For example:
      random.seed(1) generates 1,5,3,4
      and then you change to
      random.seed(2) and generates 3,2,4,2
      But if you change back to
      random.seed(1) it will return again 1,5,3,4

  • @alien2517
    @alien2517 Год назад +3

    Is there a way to print the seed at the end to save it ? Like a print(random.seed()) ?

    • @Indently
      @Indently  Год назад +3

      According to this question: stackoverflow.com/questions/64311236/how-to-find-the-seed-of-the-random-number-generator it is not possible at the moment

    • @queerstudbroalex
      @queerstudbroalex Год назад +3

      Looking at other answers, getting and setting the state is the closest you can get. s = random.getstate(); random.setstate(s)

  • @user-kt6xq9dm4x
    @user-kt6xq9dm4x Год назад

    Thanks

  • @bubblebath2892
    @bubblebath2892 5 месяцев назад

    nice video but could you please explain why does seed coz the rando to behave this way ...what does it actually do

  • @fhazzami
    @fhazzami 6 месяцев назад

    ohh i get it, so its like seed to generate world in minecraft, thanks!

    • @Indently
      @Indently  6 месяцев назад

      That's how I like to think about it as well ahah

  • @anshultanwar3212
    @anshultanwar3212 Год назад

    whats the point of passing value in seed?

  • @MangoNutella
    @MangoNutella Год назад +2

    Normally it just depends on the time.

    • @Indently
      @Indently  Год назад +2

      AGH, I knew I was forgetting something, that's absolutely correct, the seed is created depending on the system time.

    • @MangoNutella
      @MangoNutella Год назад +1

      @@Indently you're welcome

    • @vigneshm7930
      @vigneshm7930 Год назад

      Explain

  • @sudo597
    @sudo597 Год назад +2

    hello, what about re next? the regex

  • @Rr128t
    @Rr128t 4 месяца назад

    This is exactly what i need! omg 🙏🙏🥹