Python的基本输入输出函数
来源:互联网 发布:2016奥运男篮冠军数据 编辑:程序博客网 时间:2024/05/16 11:06
一 接受输入的input函数
举例如下:
>>> input('input your name')input your name cakin' cakin'>>> name = input('input your name:')input your name:cakin>>> print(name)cakin>>> year = input('The year:')The year:2017>>> print(year)2017>>> year+1Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> year+1TypeError: must be str, not int>>> int(year)+12018>>>
二 输出内容的print函数
举例如下:
>>> a = 0>>> print(a)0>>> b = 1>>> print(a+b)1>>> print(b)1>>> a = 'hello'>>> print(a)hello>>> l = [1,2,3]>>> print(l)[1, 2, 3]>>> t = (4,5,6)>>> print(t)(4, 5, 6)>>> print(l,t)[1, 2, 3] (4, 5, 6)>>> print(l,'\n',t)[1, 2, 3] (4, 5, 6)>>> for i in t:print(i)456
阅读全文
0 0
- Python的基本输入输出函数
- python 基本输入输出函数
- python的基本输入输出
- Python的基本输入输出
- Python(基本输入输出)
- Python入门--基本输入输出
- python基本输入输出代码示例
- python学习之基本输入输出
- 我的Python学习之路之基本语法-输入输出
- C/C++基本输入输出函数
- C语言 基本输入输出函数
- C++输入输出流的基本函数及语法
- 基本的输入输出
- 基本的输入输出
- C++基本的输入输出
- Java的基本输入输出
- C++ 基本的输入输出
- Python初识与输入输出函数
- 5 什么是LSTM-RNN(长短期记忆循环神经网络)?
- windows下切换jdk的默认版本(亲测!!!)
- 29.1认识HttpClient
- 分治法——棋盘覆盖问题
- Flume的使用之二——实时监控文件的数据变化并发送到工作台
- Python的基本输入输出函数
- Python3 基础语法
- Caffe 的可视化 (二)网络结构可视化
- 前端设计师如何提高UI界面中的阅读性
- 简单实用的Python计算器
- 复选框(checkbox)和单选框(radio)与文字水平垂直居中对齐的解决方法
- Python3更全面的支持中文
- Java Number&Math类
- 二级列表购物车!!复制可用C+V