Python3 input() 函数
2024-10-14 02:22:57
Python3 input() 函数
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'> # 字符串
最新文章
- Tempter of the Bone
- Timer&;TimerTask原理分析
- 【转】Xcode添加静态库以及编译选项配置常见问题
- The solution to Force.Com IDE 29.0 PassWord Problem
- Office 2010 SP2简体中文正式版下载
- pci 相关资料
- Springboot 整合 Dubbo/ZooKeeper 详解 SOA 案例
- python新手---学习第一天
- Owin学习笔记(二) 中间件开发
- Node.js实战项目学习系列(3) CommonJS 模块化规范
- Java文件File类学习总结
- 《笔记》Apache2 mod_wsgi的配置
- Kubernetes DNS 高阶指南(转发别人 解析很详细)
- 偏流角为什么是arcsin(w/V)
- H-a
- vue.cli实现tab切换效果
- Android开发:ListView加上长按事件
- Spring-Java事物回滚失效处理
- [linux/net]策略路由实现特定主机特定路径
- 如何查看Centos版本
热门文章
- selenium java-2 chrome driver与对应版本
- vlc 网页插件的 使用与控制 API http://www.xuebuyuan.com/2224602.html
- Linux命令详解-用户管理
- Spark学习笔记3:键值对操作
- ORACLE中index的rebuild(转)
- 探究CSS中border-top属性的使用
- Docker-compose 在up之后,各个子服务容器的hosts文件中不能找到父服务的域名
- centos7环境下的Mysql5.7.22安装
- 使用AngularJS处理单选框和复选框的简单方法
- Eclipse “cannot be resolved to a type”