2020年4月12日python学习笔记————————第一块考试内容

#字典合并
# d = {"name":"Alex","age":26,"hobbie":"大保健1"}
# d2 = {"name1":"Alex","age1":26,"hobbie":"大保健"}
# d2.update(d)
# print(d2)
# print(d)


# 列表方法
# d = [1,"3","8","good"]
# print(dir(d))
# 'append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort'

#字典方法
# d = {"name":"Alex","age":26,"hobbie":"大保健1"}
# print(dir(d))
# 'clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault', 'update', 'values']

#元组方法
# d = (1,"3","8","good",1)
# print(dir(d))
# #'count', 'index
# print(d.count(1))
# print(d.index("3"))

#集合方法
# d = {1,"3","8","good",1}
# print(dir(d))
# 'clear', 'copy', 'difference', 'difference_update', 'discard', 'intersection', 'intersection_update', 'isdisjoint',
# 'issubset', 'issuperset', 'pop', 'remove', 'symmetric_difference', 'symmetric_difference_update', 'union', 'update'

# 整数方法
# a = 1
# print(dir(a))
# 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'numerator', 'real', 'to_bytes'

# 字符串方法
# a = "like"
# print(dir(a))
# 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map',
# 'index', 'isalnum', 'isalpha', 'isascii', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable',
# 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind',
# 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title',
# 'translate', 'upper', 'zfill'
# 重点掌握
# 'center', 'count', 'encode','center', 'count', 'encode', 'index','isupper', 'join', 'ljust','replace'
# 'split', 'strip', 'upper'



# Python3 的六个标准数据类型中:数字 集合 元组 字典 集合
#
# 不可变数据(3 个):Number(数字)、String(字符串)、Tuple(元组);
# 可变数据(3 个):List(列表)、Dictionary(字典)、Set(集合)。


# 运算符知识字符串可以使用 += 指向概念 汉子 :3-6字节 unicode () 不可变:根据id判断 formate 字符串
# https://www.processon.com/signup


# li = ['alex','egon','yuan','wusir','666']
# # 1.
# f = li.index("666")
# li[f] = "999"
# L = len(li)
# print(li[-(L-2):])
#
# s = "www.luffycity.com"
# s.split(".")
# print(s.split("."))


# d = {
# "Development":"开发小哥",
# "OP":"运维小哥",
# "Operate":"运营小仙女",
# "UI":"UI小仙女"
# }
#
# # sunshine:
# # 1, 增加: name : alex
# d["name"] ="alex"
# print(d)
#
# # 2, 修改: alex 改为 wusir
# d["name"] = "wusir"
# print(d)
#
# # 3, 删除: 删除 name 为 wusir
# del d["name"]
#
# # 4, 查询: "UI":"UI小仙女"
# print(d["UI"])


# 计算1+2+3...+98+99+100 (编程题)
# count = 1
# sum1 = 0
#
# while count <= 100:
# sum1+= count
# count += 1
# print(sum1)


# re = input("请输入名字:")
# re1 = input("请输入名字:")
# re2 = input("请输入名字:")
# print("敬爱可爱的%s,最喜欢在%s地方干%s"%(re,re1,re2))

# 本次考核中学员掌握并不是很扎实,不扎实的点如下。
# 1.字符串能使用+=
# a ="heel"
# b = "word!!"
# a+=b
# print(a)
# 2.学员在字符编码这里理解的不够,utf-8,gbk,unicode这些表现得不熟悉。

# 3.字典里面赋值没记住。#注意字符串加冒号

# 4.可变类型和不可变类型得判断不知道。

# 5.字符串拼接方法.format()没怎么用过。
a.format()
原文地址:https://www.cnblogs.com/jianchixuexu/p/12685004.html