摘要: msg_dic={ 'apple':10, 'tesla':100000, 'mac':3000, 'lenovo':30000, 'chicken':10, } shop_list=[] while True: for k in msg_dic: print(k,msg_dic[k]) input 阅读全文
posted @ 2017-12-14 10:49 银鑫 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 标准数据类型 标准数据类型 Python3 中有六个标准的数据类型: Number(数字) String(字符串) List(列表) Tuple(元组) Sets(集合) Dictionary(字典) 数字 数字 字符串 字符串 >>> name="yinxin" >>> name[0] 'y' > 阅读全文
posted @ 2017-12-14 10:43 银鑫 阅读(277) 评论(0) 推荐(0) 编辑
摘要: while实现2-3+4-5+6...+100 的和可以看到规律为2-100内所有奇数都为减法,偶数为加法设定变量 total=0; count=2 当count为偶数时与total相加,反则相减,如下: 1 total=0 2 count=2 3 while count<101: 4 if count%2 == 0: 5 total += coun... 阅读全文
posted @ 2017-12-04 18:46 银鑫 阅读(682) 评论(0) 推荐(0) 编辑
摘要: python是一种解释型、面向对象、动态数据类型的高级程序设计语言。 执行Python程序: python的两种编写方式 交互式编程 交互式编程不需要创建脚本文件,是通过 Python 解释器的交互模式进来编写代码。 linux上你只需要在命令行中输入 Python 命令即可启动交互式编程,提示窗口 阅读全文
posted @ 2017-12-04 18:31 银鑫 阅读(419) 评论(0) 推荐(0) 编辑