Python variable scope 🔬

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ย. 2024

ความคิดเห็น • 34

  • @BroCodez
    @BroCodez  3 ปีที่แล้ว +17

    # scope = The region that a variable is recognized
    # A variable is only available from inside the region it is created.
    # A global and locally scoped version of a variable can be created
    name = "Bro" # global scope (available inside & outside functions)
    def display_name():
    name = "Code" # local scope (available only inside this function)
    print(name)
    display_name()
    print(name)

  • @garymaya1767
    @garymaya1767 ปีที่แล้ว +4

    Thank you for making this so easy to understand!!! Excellent info!

  • @OmarEl3fefy
    @OmarEl3fefy ปีที่แล้ว +2

    thank you man about this hard work

  • @NadyaNinis-p3y
    @NadyaNinis-p3y หลายเดือนก่อน

    well explained! thank you! you are much appreciated

  • @nemuirostorageroom
    @nemuirostorageroom 2 ปีที่แล้ว +2

    So easy to understand. Thank you.

  • @Serpaal
    @Serpaal หลายเดือนก่อน

    thank you for making this video

  • @globalgrowth343
    @globalgrowth343 2 ปีที่แล้ว +2

    I finally understand it.

  • @spartanranger
    @spartanranger 3 ปีที่แล้ว +2

    Thank you Bro Bro.

  • @thatskempo5874
    @thatskempo5874 3 ปีที่แล้ว +1

    Mr worldwide!

  • @Toni-nw1dk
    @Toni-nw1dk 3 ปีที่แล้ว +1

    nice!

  • @tarikyassa1076
    @tarikyassa1076 3 ปีที่แล้ว +1

    Thanks bro!

  • @gokulc7043
    @gokulc7043 3 ปีที่แล้ว +1

    Thanks bro

  • @uuhju7004
    @uuhju7004 3 ปีที่แล้ว +1

    yes

  • @airlanggak5391
    @airlanggak5391 3 ปีที่แล้ว +1

    thanks bro code!

  • @emadeldeennassar543
    @emadeldeennassar543 3 ปีที่แล้ว +1

    Thanks a lot

  • @kemann3815
    @kemann3815 2 ปีที่แล้ว

    Lovely

  • @neeraj4210
    @neeraj4210 3 ปีที่แล้ว +1

    ❤️

  • @happycoder72
    @happycoder72 2 ปีที่แล้ว

    im a bro ye im a bro
    appreciate your work

  • @Dunith_Munasinghe
    @Dunith_Munasinghe ปีที่แล้ว

    Thanks Bro

  • @devilfelex6369
    @devilfelex6369 9 หลายเดือนก่อน

    THANK YOU

  • @manuela7477
    @manuela7477 ปีที่แล้ว

    Thanks Bro!

  • @budderrar5751
    @budderrar5751 ปีที่แล้ว

    noice

  • @victorlefeu
    @victorlefeu ปีที่แล้ว

    thanks

  • @nikoprieto1
    @nikoprieto1 ปีที่แล้ว

    Bro!
    There´s any other function where variables can be allocated as Local?
    I mean, now i know that when I DEF a function, I cant use outside the variables inside that function. There´s any other space like DEF that makes a variable a local variable?
    Thanks bro, hugs from Colombia

  • @beingzero7541
    @beingzero7541 2 ปีที่แล้ว

    Wow!

  • @salmanazhar6479
    @salmanazhar6479 2 ปีที่แล้ว

    let's go

  • @shasvat0
    @shasvat0 ปีที่แล้ว

    commented

  • @CarlKho
    @CarlKho ปีที่แล้ว

    Literally binging you

  • @techlace1195
    @techlace1195 2 ปีที่แล้ว

  • @pbsmoothie7281
    @pbsmoothie7281 ปีที่แล้ว

    TH-cam Algorithm comment

  • @zzzewd018
    @zzzewd018 2 ปีที่แล้ว

    hi everyone

  • @Xenonandplutonium
    @Xenonandplutonium 8 หลายเดือนก่อน

    👍🧪

  • @djoezi3662
    @djoezi3662 2 ปีที่แล้ว

    cool man. continue🦾

  • @felipebenini217
    @felipebenini217 2 ปีที่แล้ว

    Thank you bro