Created
February 28, 2019 10:56
-
-
Save MrDMurray/c2991c7110e047d10958cb7d97235f6d to your computer and use it in GitHub Desktop.
Returning Functions Python Examples
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
#example 1 | |
def make_foodz(): | |
your_pasta=input("What kind of pasta would you like?") | |
print("Sure, I'll make you some delicous", your_pasta) | |
#return your_pasta | |
#program starts here | |
print("It's dinner time!") | |
print("I have returned from the kitchen with...", make_foodz() ) | |
#example 2 | |
def calc_fecks(): | |
print("Ladies and gentlemen..") | |
return x | |
print("The ammount of fecks given today shall be Exactly", calc_fecks()) | |
#example 3 | |
import datetime | |
def get_da_time(): | |
x = datetime.datetime.now() | |
return x | |
#program starts here | |
print("What time is EXACTLY?") | |
print("The current time is", get_da_time()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment