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

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 )

Twitter picture

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

Facebook photo

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

Connecting to %s

Create your website with WordPress.com
Get started
%d bloggers like this: