Last active
August 29, 2015 14:21
-
-
Save Yagisanatode/5ba481f93b98b7a12ff6 to your computer and use it in GitHub Desktop.
Returning A Value From A Function To Be Used Outside The Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###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