Advertisement
JkSoftware

Day 8 - Even more on Functions

Nov 11th, 2021
938
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.64 KB | None | 0 0
  1. #create a function called greet()
  2. #Write 3 print statements inside the function
  3. #call the greet() function to run your code
  4.  
  5.  
  6. #
  7. # def greet():
  8. #     print("Hello!")
  9. #     print("Howdy")
  10. #     print("yo!")
  11.  
  12.  
  13. # greet()
  14.  
  15.  
  16.  
  17. #         #Parameter: Name of data passed in
  18. # def greet_(name):
  19. #     print(f"Hello {name}")
  20. #     print(f"How do you do {name}?")
  21.  
  22. #        #Argument: Value of the data passed in
  23. # greet_("Johnny")
  24. # greet_("John")
  25. # greet_("Angela")
  26.  
  27.  
  28. def hellos(name, location):
  29.     print(f"Hello {name}")
  30.     print(f"How is the weather in {location}")
  31.  
  32. hellos("Johnny", "Ohio")
  33. hellos(location="Ohio", name="Johnny")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement