该系列为南京大学课程《用Python玩转数据》学习笔记,主要以思维导图的记录
1.1 Python简介
1.2 第一个Python程序
1.3 Python语法基础
1.4 Python数据类型
1.5 Python基本运算
1.6 Python的函数、模块和包
测试
题目:简单的输入输出:
1 | surname = input('input your surname:') |
讨论
关于round函数:
在python2.x中:0.5会近似到距离0远的一端,比如 :
1 | round(0.5) = 1 |
Values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done away from 0.
在python3.x中:0.5会近似到偶数那边,比如:
1 | round(2.5) = 2 |
values are rounded to the closest multiple of 10 to the power minus ndigits; if two multiples are equally close, rounding is done toward the even choice.