Understanding the scope of a function

Поделиться
HTML-код
  • Опубликовано: 8 июл 2024
  • Functions have their own section that the rest of the Python code cannot access, that's called the scope.

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

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

    thanks for your video it was descriptive and clear, i like the way you taught, by the way in your example i chained the multiplication with conditional statement if the multiplication is true i change the state of the has_calculated variable to true then return the value of the multiplication which i stored in a variable inside the function if you use the keyword global is going to change the and modify the variable outside the function

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

    Sensei, doesn't that make local and global variables are treated differently in GDScript?