#!/usr/bin/env python3

globalInt = 111

# the first string in a function body is the docstring
def hello():
    "function hello(): "    # the docstring
    globalInt = 22          # a local variable

    global helloInt         # becomes global
    helloInt = 33 // 2      # integer dividion (floor)    
    return hello.__doc__

print()
print("*************")
print("scope testing")
print("*************")
a = 0
for i in range(4):
  b = i
  a += i
  print("   in loop: ", a, b)

print()
print("after loop: ", a, b)       
print()
print(" globalInt: ", globalInt )  

# helloInt only created if hello called at least once
# print("  helloInt: ",  helloInt )   

print()
print("*********")
print("docstring")
print("*********")
print(hello.__doc__ + "The docstring of the function hello ")
print(hello())
