simplefunction.py 772 B

1234567891011121314151617181920
  1. def example(firstargument, secondargument, thirdargument="N/A"):
  2. """ Prints a string based on the two arguments. """
  3. # This is python3.6 syntax:
  4. # print(f"{firstargument} is the first argument.")
  5. print("{} is the first argument.".format(firstargument))
  6. print("{} is the second argument.".format(secondargument))
  7. print("{} is the third argument.".format(thirdargument))
  8. if __name__ == "__main__":
  9. """
  10. Some examples on simple functions.
  11. And docstring stuff that will probably have to be updated when I know more.
  12. """
  13. # You can just use parameters in order
  14. example("My first argument", "my second argument")
  15. # but better to use the names
  16. example(secondargument = "#2!", firstargument = "#1!", thirdargument = "#3!")