Python syntax exercises--user interaction

黄舟
Release: 2016-12-28 17:28:19
Original
1040 people have browsed it

#!/usr/bin/env python
# -*- coding:utf8 -*-
name = input("请输入您的名字:")
print (name)
----------------------------------------------
Python 2.0 Python 3.0
input == eval
raw_input == input
------------------------------------
Copy after login

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)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!