Python Forum
Which GUI can have indefinite loop ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Which GUI can have indefinite loop ?
#14
Thanks, I see it much much clearer now.

So a function has its own scope, and if I use any variable it will be treated as a new variable even if there is already the same variable outside of it.

-edit-
I just realized that I was wrong.

A function has a LOCAL scope so if I make a variable even if it is the same name as the variable outside of the function, it will be treated as local, but if I want to use the one that's on the global I have to tell it inside the function. It's not declaring a new one, but using the outside one.

It's quite confusing I prefer if there's already existing variable then it will use that because I hardly use variable name that already exists
Reply


Messages In This Thread
Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 06:53 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 07:10 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 07:42 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 09:20 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 09:23 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-15-2023, 09:37 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 05:28 AM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 07:32 AM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 08:41 AM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 09:35 AM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 08:01 PM
RE: Which GUI can have indefinite loop ? - by jst - Nov-16-2023, 10:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Init an indefinite number of class MathisDELAGE 9 2,454 Feb-18-2022, 07:49 PM
Last Post: deanhystad
  Indefinite loop ( I think ) marsh20 2 2,002 Aug-20-2020, 12:33 PM
Last Post: deanhystad
  indefinite loop Johnygo 3 2,205 Jul-03-2019, 12:53 PM
Last Post: Johnygo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020