Keyword Arguments Demo,keywordarguments,# Functions
Keyword Arguments Demo,keywordarguments,# Functions
# Functions can also be called using keyword arguments of the form # 'keyword = value'.def parrot(voltage, state='state', action='action', type='type'): print '-- Action:', action, print 'Vol', voltage print '-- type:', type print '-- state', stateparrot(1000)parrot(action = 'A', voltage = 1000000)parrot('A', state = 'B')parrot('A', 'B', 'C')
- A tuple containing an integer,tuplecontaining,y = (40,
- String concatenation Demo,,print 'You c
- Int, string, function, and list as list element,string
- range() Function,rangefunction,# iterate ov
- Get the length of a string with escape characters inside,
- Mouse action: drag,mouseactiondrag,from Tkinter
热门文章:
相关内容
- A tuple containing an integer,tuplecontaining,y = (40,)
- String concatenation Demo,,print 'You c
- Int, string, function, and list as list element,stringelement,foo =
- range() Function,rangefunction,# iterate ov
- Get the length of a string with escape characters inside,escapechar
- Mouse action: drag,mouseactiondrag,from Tkinter
- Get an exception's argument,exceptionargument,# try: nu
- Collecting Parameters,collecting,def print_pa
- Reading a file: readlines and xreadlines,,file = open(
- While loop demo,whileloopdemo,x = 1while x
评论关闭