Hello everyone , I meet you again , I'm your friend, Quan Jun .
Python2.x edition :
1. raw_input:
Format :result = raw_input(‘ Prompt information ’)
function : Will wait for user input , Until the user presses Enter, The content entered by the user will be regarded as ” character string ”, Variables passed to the receiver
2. input:
Format : result = input(‘ Prompt information ’)
function : Will wait for user input , Until the user presses Enter, The content entered by the user will be regarded as “ Code ” To deal with !
Python3.x edition :
stay Python3.x There is no raw_input function , Only input function . here input function ==raw_input function . The input content will be input as a string .
stay 3.x How to implement in version 2.x In version input Function? ?
Use input function +eval function
Python2.x In the version
It uses print sentence :print xxx
Output a variable :print Variable name
Output multiple variables :print Variable name 1, Variable name 2
Python3.x In the version
It uses print function :print(xxx) print Functions are more powerful , There are many parameters .
Output a variable :print ( Variable name )
Output multiple variables :print ( Variable name 1, Variable name 2)
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/147182.html Link to the original text :https://javaforall.cn