07 2019 档案
摘要:一、字符串范例 str = 'abcdef' 二、字典范例
阅读全文
摘要:分2种情况: 容器有索引,包括:list, str, tuple三种数据类型,可使用while来实现此功能。 例子: ls = [1, 3, 2, 5, 4] count = 0 while count < len(ls): print(ls[count]) count += 1 容器没有索引,包括
阅读全文
摘要:1、堆、栈,是两种数据结构。 2、堆,队列优先,先进先出(FIFO—firstinfirstout) 栈,先进后出(FILO—First-In/Last-Out) 3、堆栈空间分配 栈(操作系统):由操作系统自动分配释放,存放函数的参数值,局部变量的值等。 堆(操作系统):一般由程序员分配释放,若程
阅读全文
摘要:一种方式:print("大值:{} | 小值:{} | 平均值:{}".format(max, min, (sum / count))) 输出结果:大值:98 | 小值:21 | 平均值:49.666666666666664二种方式: num = input('请%s输入第%s个整数:' % (fl
阅读全文

浙公网安备 33010602011771号