Home > Article > Backend Development > Python syntax exercises--user interaction
#!/usr/bin/env python # -*- coding:utf8 -*- name = input("请输入您的名字:") print (name) ---------------------------------------------- Python 2.0 Python 3.0 input == eval raw_input == input ------------------------------------
input: Type conversion will be done based on the user's input. raw_input: The user's input will be processed as a string. Example:
If you enter "57 + 3": input will get the integer 60raw_input will Get the string "57 + 3"
The above is the Python grammar exercise-the content of user interaction. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!