256 Kilobytes

Answers in Computer Programming | By K. Crezcheezy


694 views, 0 RAMs, and 2 comments

Tags: Python, Programming, Variables, Global, Programming Help

Profile Photo - K. CrezcheezyK. Crezcheezy256KB WriterTye, TXClassic User

I've recently started learning computer programming and picked up Python but I need some help with new terms. What exactly do "global variables" in Python do?

Download more RAM. 🐏 ⨉ 0Posted by K. Crezcheezy 2 years ago 🕓 Posted at 19 March, 2019 22:44 PM PDT

Smoke weed literally every day unless you don't want to go to hell.

Profile Photo - KacssPLKacssPL256KB WriterVergennes, VTClassic User

Basically a global variable is defined and declared outside a function and needed to be used inside of a function. For a good example on how this works this website explains it well:


Download more RAM. 🐏 ⨉ 0Posted by KacssPL 2 years ago 🕓 Posted at 30 March, 2019 15:57 PM PDT


Profile Photo - Defaultgermyrinn

Variables that are created outside of a function are known as Global Variables. A global variable is one that can be accessed anywhere . This means, global variable can be accessed inside or outside of the function. In most cases where you are tempted to use a global variable, it is better to utilize a parameter for getting a value into a function or return a value to get it out. Like in many other program structures, Python also imposes good programming habit by design.

Mod Edit: Spam link removed.

Download more RAM. 🐏 ⨉ 0Posted by germyrinn 1 year ago

Edit History

• [2020-03-18 22:58 PDT] germyrinn (1 year ago)
🕓 Posted at 18 March, 2020 22:58 PM PDT

Post a New Comment

Do you like having a good time?

Register an Account

You can also login to an existing account or reset your password. All use of this site is subject to the terms of service and privacy policy.

Read Quality Articles

Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.

View Articles →

Argue with People on the Internet

Use your account to explain why people are wrong on the Internet forum.

View Forum →

Vandalize the Wiki

Or don't. I'm not your dad.

View Wiki →

Ask and/or Answer Questions

If someone asks a terrible question, post a LMGTFY link.

View Answers →

Make Some Money

Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.

Register an Account

Answers— Read More

Find more related content below!