256 Kilobytes

Answers in Computer Programming | By K. Crezcheezy

Published 1 year agoTue, 19 Mar 2019 22:44:13 -0700

252 views, 0 RAMs, and 2 comments

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

Profile Photo - K. Crezcheezy K. Crezcheezy 256KB Writer Tye, TX
🗎 39 🗨 0 🐏 0
Classic 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. 🐏 ⨉ 0 Posted by K. Crezcheezy 1 year 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 - KacssPL KacssPL 256KB Writer Vergennes, VT
🗎 0 🗨 132 🐏 0
Classic 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. 🐏 ⨉ 0 Posted by KacssPL 1 year ago 🕓 Posted at 30 March, 2019 15:57 PM PDT


Profile Photo - Default germyrinn
🗎 0 🗨 1 🐏 0

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. 🐏 ⨉ 0 Posted by germyrinn 2 weeks ago

Edit History

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

Post a New Comment

To leave a comment, login to your account or create an account.

Do you like having a good time?

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
You can also login to an existing account or recover your password. All use of this site is subject to terms outlined in the terms of service and privacy policy.