Python3 input() 函数

 Python3 内置函数

Python3.x 中 input() 函数接受一个标准输入数据,返回为 string 类型。

注意:在 Python3.x 中 raw_input() 和 input() 进行了整合,去除了 raw_input( ),仅保留了input( )函数,其接收任意任性输入,将所有输入默认为字符串处理,并返回字符串类型。

函数语法

input([prompt])

参数说明:

  • prompt: 提示信息

实例

input() 需要输入 python 表达式

>>>a = input("input:") input:123 # 输入整数 >>> type(a) <class 'str'> # 字符串 >>> a = input("input:") input:runoob # 正确,字符串表达式 >>> type(a) <class 'str'> # 字符串

最新文章

  1. Tempter of the Bone
  2. Timer&amp;TimerTask原理分析
  3. 【转】Xcode添加静态库以及编译选项配置常见问题
  4. The solution to Force.Com IDE 29.0 PassWord Problem
  5. Office 2010 SP2简体中文正式版下载
  6. pci 相关资料
  7. Springboot 整合 Dubbo/ZooKeeper 详解 SOA 案例
  8. python新手---学习第一天
  9. Owin学习笔记(二) 中间件开发
  10. Node.js实战项目学习系列(3) CommonJS 模块化规范
  11. Java文件File类学习总结
  12. 《笔记》Apache2 mod_wsgi的配置
  13. Kubernetes DNS 高阶指南(转发别人 解析很详细)
  14. 偏流角为什么是arcsin(w/V)
  15. H-a
  16. vue.cli实现tab切换效果
  17. Android开发:ListView加上长按事件
  18. Spring-Java事物回滚失效处理
  19. [linux/net]策略路由实现特定主机特定路径
  20. 如何查看Centos版本

热门文章

  1. selenium java-2 chrome driver与对应版本
  2. vlc 网页插件的 使用与控制 API http://www.xuebuyuan.com/2224602.html
  3. Linux命令详解-用户管理
  4. Spark学习笔记3:键值对操作
  5. ORACLE中index的rebuild(转)
  6. 探究CSS中border-top属性的使用
  7. Docker-compose 在up之后,各个子服务容器的hosts文件中不能找到父服务的域名
  8. centos7环境下的Mysql5.7.22安装
  9. 使用AngularJS处理单选框和复选框的简单方法
  10. Eclipse “cannot be resolved to a type”