"""
I have added this section, without learning OOP this is the way that we can
show how to use global and local variables.
Updating global variables in this way will lead into using OOP instance variables and methods.
Subroutines that return a value are called functions
They use the key word return
Follow the key word return with the value/variable you want to return.
Make sure that when you call the subroutine you assign the return value to a variable. See lines 31, 37 and 42.
"""

# Global variables
name = "bob"
subject = "Computer Science"
group = "15AA"

def updateName():
	name = input("Enter the new name: ")
	return name

def updateSubject():
	subject = input("Enter the new subject: ")
	return subject

def updateGroup():
	group = input("Enter the new subject: ")
	return group

# Print out the original name
print("Your name is:", name)
# use the updateName subroutine to assign a new value to the variable name
name = updateName()
#print out the updated name
print("Your updated name is:", name)

# update the subject
print("Your subject is:", subject)
subject = updateSubject()
print("Your updated subject is:", subject)

# update the group
print("Your group is:", group)
group = updateGroup()
print("Your updated group is:", group)


"""
I have added this section, without learning OOP this is the way that we can
show how to use global and local variables.
Updating global variables in this way will lead into using OOP instance variables and methods.
Subroutines that return a value are called functions
They use the key word return
Follow the key word return with the value/variable you want to return.
Make sure that when you call the subroutine you assign the return value to a variable. See lines 31, 37 and 42.
"""

# Global variables
name = "bob"
subject = "Computer Science"
group = "15AA"

def updateName():
	name = input("Enter the new name: ")
	return name

def updateSubject():
	subject = input("Enter the new subject: ")
	return subject

def updateGroup():
	group = input("Enter the new subject: ")
	return group

# Print out the original name
print("Your name is:", name)
# use the updateName subroutine to assign a new value to the variable name
name = updateName()
#print out the updated name
print("Your updated name is:", name)

# update the subject
print("Your subject is:", subject)
subject = updateSubject()
print("Your updated subject is:", subject)

# update the group
print("Your group is:", group)
group = updateGroup()
print("Your updated group is:", group)


I have added this section, without learning OOP this is the way that we can show how to use global and local variables. Updating global variables in this way will lead into using OOP instance variables and methods. Subroutines that return a value are called functions They use the key word return Follow the key word return with the value/variable you want to return. Make sure that when you call the subroutine you assign the return value to a variable. See lines 31, 37 and 42. # Global variables # Print out the original name # use the updateName subroutine to assign a new value to the variable name #print out the updated name # update the subject # update the group