Design a site like this with WordPress.com
Get started

Global variables in Python!

1. Global variables are variables used within and without the functions: reference: W3schools: Python tutorial.

2. In this case: unless you run the program using ‘Desktop Site’ on smartphone: the code would run into ‘indentation error’ during compilation. Works fine on desktop.

3. Note: since function is being called only after the first print command: it first prints ‘awesome’ and then ‘fantastic.'( global keyword)

Author: dancinglightofgrace

You

One thought on “Global variables in Python!”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: