Python 3.4 - Keyword Arguments

 You can make functions that have keywords for arguments. Python will assume that the keywords you assign to the function are the ones in order in relation to the preset argument position (i.e. x, y, z). If you want to assign position you can specify this.

def dumb_sentence(name="matt", action='ate', item='food'):
    print(name, action, item)

dumb_sentence('Lizzy', 'sleeps', 'softly')


https://www.youtube.com/watch?v=DASOXeFFkCg

Comments

Popular posts from this blog

Python 3.4 - Caesar Cipher

UML - Use Case Diagram