⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default_argument_values.py

📁 python编程很好的入门材料,包括讲义和源码.
💻 PY
字号:
#-------------------------------------------------------------------------------
# Note how the argument "playersName" has a default value assigned to it.
# This will allow us to call the function even when have no player name to pass
# in to it.
#-------------------------------------------------------------------------------

def printGameOver( playersName="Guest" ):
    print "Game Over... " + playersName + "!"

# Now, lets call our new function and pass in some player names...

printGameOver( "camper_boy" )
printGameOver( "Haxxor" )
printGameOver( "c1pher" )
printGameOver()            # This call passes no name... so it will use "Guest"

raw_input( "\nPress Enter to exit..." )

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -