随笔分类 -  python-a-开发基础

摘要:# 1. 列表['alex','egon','yuan','wusir','666'](编程)## - 1.把666替换成999# - 2.获取"yuan"索引# - 3.假设不知道前面有几个元素,分片得到最后的三个元素 # li[-1] = '999'# li[li.index('666')] = 阅读全文
posted @ 2018-02-09 12:18 Alice的小屋 阅读(411) 评论(0) 推荐(0) 编辑
摘要:常用的小方法: bin() oct() hex() chr() ord() dir() id() len() int() str() type() help() range(10) / range(1,10,2) enumerate(li) / enumerate(li,3) hash() 阅读全文
posted @ 2018-02-09 11:45 Alice的小屋 阅读(156) 评论(0) 推荐(0) 编辑
摘要:python - 数据类型: 基本类型: 1.数字 整数int 长整型long 浮点型float 2.字符串 文本str 字节bytes 3.布尔 true false数据集: 1.列表list 2.元祖tuple (数组) 3.字典dict 有序字典 无序字典 4.集合set 有序集合 无序集合 阅读全文
posted @ 2018-02-08 17:40 Alice的小屋 阅读(240) 评论(0) 推荐(0) 编辑
摘要:1.二进制 八进制 十六进制 二进制: bin() 0b10010八进制: oct() 0o10十进制: 1-100十六进制: hex() 0X53 BH 十进制转2, 8,16进制: >>> bin(144)'0b10010000'>>> >>> oct(8)'0o10'>>> >>> hex(1 阅读全文
posted @ 2018-02-08 13:18 Alice的小屋 阅读(1688) 评论(0) 推荐(0) 编辑
摘要:程序开发的原则: 写重复代码 是可耻的行为; 1.while 条件: 执行代码... #循环打印0-100count = 0 while count <= 100: print("loop ",count) count += 1 print(" end ") #打印偶数count = 0 while 阅读全文
posted @ 2018-02-02 20:38 Alice的小屋 阅读(1245) 评论(0) 推荐(0) 编辑
摘要:python:用户交互: 等用户输入,做反应; username=input("username:")password=input("password:")print(username,password) 注释:# 1.不好理解的地方加注释 2.中文可用中文,英文,不用拼音 数据类型:integer 阅读全文
posted @ 2018-02-02 20:36 Alice的小屋 阅读(281) 评论(0) 推荐(0) 编辑
摘要:python的官网: https://www.python.org/ Python环境安装 Windows 安装https://www.python.org/downloads/windows/ Windows x86-64 executable installer 解释器:把Python得语法解释 阅读全文
posted @ 2018-02-01 23:09 Alice的小屋 阅读(217) 评论(0) 推荐(0) 编辑