Skip to content

Instantly share code, notes, and snippets.

@Yagisanatode
Last active August 29, 2015 14:21
Show Gist options
  • Save Yagisanatode/5ba481f93b98b7a12ff6 to your computer and use it in GitHub Desktop.
Save Yagisanatode/5ba481f93b98b7a12ff6 to your computer and use it in GitHub Desktop.
Returning A Value From A Function To Be Used Outside The Function
###Using a variable in a function from outside the function###
###Returning a value from a function to be used outside the function.###
# Returns a string in lowercase
def Make_Lowercase(cmt):
cmt = cmt.lower()
return cmt
comment = "My name is SCOTT."
print ("Commment without lowercase formatting:")
print (comment)
print("")
#Replace the old variable with the lowercase one created in the function
comment = Make_Lowercase(comment)
print ("Comment run through function to make it lowercase:")
print (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment