Advertisement
ganiyuisholaafeez

Function Definition

Feb 11th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. # A function called easy_money with no parameter that has a return value of 100
  2.  
  3. def easy_money():
  4.     return 100
  5.  
  6. # A function called best_food_ever with no parameter that has a return value of "Sushi"
  7.  
  8. def best_food_ever():
  9.     return "Sushi"
  10.  
  11. # A function called convert_to_currency that accepts a single parameter (integer)
  12. # The function also convert an argument to a str and prepend it with a $ when
  13. # returning the result
  14.  
  15. def convert_to_currency(currency: int):
  16.     converter = "$" + str(currency)
  17.     return converter
  18.  
  19. print(easy_money())
  20. print(best_food_ever())
  21. print(convert_to_currency(15))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement