Advertisement
dewabe

SimpleSample: Functions

Aug 15th, 2015
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # SimpleSample functions
  3.  
  4. # Just return...
  5. def my_func():
  6.     return "Hello World!"
  7.  
  8. print(my_func())
  9.  
  10. # Print inside function
  11. def calculator(a, b):
  12.     print "{} + {} = {}".format(a, b, (a+b))
  13.  
  14. calculator(1,2)
  15.  
  16. # Using another functions
  17. def combined():
  18.     print(my_func())
  19.     print("This is message from combined function")
  20.     calculator(100,200)
  21.  
  22. combined()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement