Python基础练习
W_X_C
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python_字符串的基本使用
# 字符串定义和遍历 str1 = "hello python" str2 = "我的名字是“good" print(str2) print(str1[6]) for char in str2: print(char) # 字符串统计操作 str1 = "hello python" # 1. 统计字符串长度 print(len(str1)) #2. 统计某一个子字符串出现的次数 print(str1.count('llo')) print(str1.count('abc')) #3..翻译 2020-06-24 20:42:09 · 284 阅读 · 0 评论 -
Python_字典的基本使用
# 字典是一个无序的数据集合,使用print函数输出字典时 # 输出的顺序和定义的顺序不一定一致 xiaoming = {"name": "小明", "age": 18, "gender":True, "height": 1.75, "weight": 75} print(xiaoming) #字典的基本使用 xiaoming_dict = {"name": "小明"} # 1. 取值 prin.翻译 2020-06-24 20:13:32 · 267 阅读 · 0 评论 -
Python_元组的基本使用
Python元组的基本使用翻译 2020-06-24 19:46:20 · 279 阅读 · 0 评论 -
Python_列表的基本使用
Python 列表的基本使用,数据统计,列表排序,列表的遍历翻译 2020-06-21 19:56:24 · 229 阅读 · 0 评论 -
Python 乘法口诀
def math_99(): # 打印九行 row = 1 while row <= 9: col = 1 while col <= row: print("%d * %d = %d " %(col, row, col * row), end="\t") col += 1 print("") row += 1 math_99() end= 代表:pri.原创 2020-06-21 19:17:10 · 335 阅读 · 0 评论
分享