Stop Using Print to Debug in Python. Use ICECREAM Instead 🍧

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

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

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

    Nice short, very straightforward, and useful video.

  • @guinea_horn
    @guinea_horn 9 месяцев назад

    So it's f strings but not built into the language? Why not use print(f"{user_weight=}")

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

    Nice thx. Useful

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

    what magic did ic use to know the variable/function name?

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

      The most pythonic way I can think of is using f-strings (3.8 required)
      pi = 3.14159
      print(f”{pi=}”)
      ---------
      pi=3.14159
      ---------
      This does however require you to know the name, so the library is probably directly reading locals() and or globals()…
      If you want to know how the F-String knows the variable name, you’d probably have to dig in the c source code for python.

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

      @@raumi_ Thanks for your explanation

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

    Nice thanks

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

    so cool

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

    Yoooooooo bro