Skip to content
  1. Functions With Inputs
  2. put variable inside parentheses in def statement.
  3. then include a value when you call the function
  4. parameter is what's defined in the function def my_func (parameter)
  5. argument is what you call the function with my_func(argument)
  6. Positional vs Keyword
  7. multiple parameters Just separate with commas
  8. up to now these are positional arguments.
  9. Keyword arguments
    def my_func(name, location): 
    
    my_func(name = "John", location = "Texas") 
    
  10. math.ceil() will round a number up.
  11. gallons = math.ceil (area / cover)
  12. list.index (list_item) returns index of 1st match
  13. index = alphabet.index("c") # Result: index = 2

tagcheck

tagcheck