Pass immutable and mutable value into function,immutablemutable,def changer(
Pass immutable and mutable value into function,immutablemutable,def changer(
def changer(x, y): x = 2 # changes local name's value only y[0] = 'spam' # changes shared object in placeX = 1L = [1, 2] changer(X, L) # pass immutable and mutableprint X, L L = [1, 2]changer(X, L[:]) # pass a copyprint X, L
- Nest lists (create lists containing other lists),lists
- Random integer chosen from range(6),randomchosen,impor
- Default Argument Values: If you don't want the d
- Keyword Parameters and Defaults,parametersdefaults,def
- Label font,labelfont,from Tkinter
- Convert string: to and from string,convertstring,print
热门文章:
相关内容
- Nest lists (create lists containing other lists),listscontaining,q
- Random integer chosen from range(6),randomchosen,import rando
- Default Argument Values: If you don't want the default to be
- Keyword Parameters and Defaults,parametersdefaults,def hello_1(
- Label font,labelfont,from Tkinter
- Convert string: to and from string,convertstring,print int('4
- Searching a list for an integer.,searchinginteger,# Create a l
- ZeroDivisionError Demo,zerodivisionerror,try: 1/0exce
- String splits by another string,stringsplits,line = 'i'mS
- Define and use Module: import,definemodule,#//mod3.pyX
评论关闭