Python Programming Tutorial Part 3: Functions and Global Variables

preview_player
Показать описание
In this video I go provide a brief introduction to global variables in Python. Global variables are variables that are defined outside of all functions in your program and so they are accessible by all functions in the program.

Covered in the video are global variables, the global keyword, precautions about using global variables, a discussion on global vs local variables, and a coding example.
Рекомендации по теме
Комментарии
Автор

Thank you Hank for explaining, please continue your work. I live in Sweden

ianonamu
Автор

Thanks! I'm on a hunt for tips on how to avoid global variables. There are tons of videos explaining how to use them, and always say don't do it. I haven't found much yet giving alternative practices.

I'm always finding myself creating variables, and changing them with functions. I don't know a way to change them otherwise.

dviant
welcome to shbcf.ru