python named parameters code example
Example 1: python keyword arguments
def function(arg,kwarg='default'):
return [arg,kwarg]
Example 2: ruby named parameters
def show_name_and_address(name: "Someone", address: "Somewhere")
puts "#{name}, #{address}"
end
show_name_and_address
show_name_and_address(name: 'Andy')
show_name_and_address(address: 'USA')
Example 3: ruby named parameters
def show_name_and_address(name="Someone", address="Somewhere")
puts "#{name}, #{address}"
end
show_name_and_address
show_name_and_address('Andy')