EdmontonPy
Inspired by the Python community, we hope to foster a strong, supportive, and proficient Python community in the Edmonton area.
edmontonpy.com
@edmontonpy
edmontonpy.slack.com
Eddie Santos
Tutorial 5: Web Servers
Andrew Crouse & Daniel Mouris
Eddie Santos
NEXT MEETUP ON NOVEMBER 13TH DUE TO REMEMBRANCE DAY
Use * to send lists and dictionaries as positional and keyword arguments when calling a function
total = sum(*list_of_small_nums, *list_of_large_nums)
# total == 66
Python 3.5+ allows passing multiple sets of keyword arguments (kwargs) to a function in a single call
def sum(*args):
total = 0
for arg in args:
total += arg
return total
list_of_small_nums = [1, 2, 3]
total = sum(*list_of_small_nums)
# total == 6
list_of_large_nums = [10, 11, 12, 13, 14]
total = sum(*list_of_large_nums)
# total == 60
By EdmontonPy
Inspired by the Python community, we hope to foster a strong, supportive, and proficient Python community in the Edmonton area.