摘要: #___author: #date: 2021/6/8#集合创建和删除 集合是不可重复的a = {10,20,30,40,50}a.add(60) #添加print(a)#将列表,元组等可迭代的对象转成集合a = [10,20,30,40,50,50,60]b = set(a) #将列表转化成集合p 阅读全文
posted @ 2021-07-28 09:15 幻奇 阅读(42) 评论(0) 推荐(0)
摘要: #___author: #date: 2021/6/9# a = input("请输入")# if int(a) >= 10:# print(a)# else:# print(True)# b = input("请输入")# print(b if int(b)>=10 else "数字太大" ) # 阅读全文
posted @ 2021-07-28 09:15 幻奇 阅读(78) 评论(0) 推荐(0)
摘要: #___author: #date: 2021/6/5#字典的创建a = {'name':'小王','age':225,'job':'programmer'} #创建字典b = dict(name='小王',age=21,job='programmer') #dict创建字典c = dict([(' 阅读全文
posted @ 2021-07-28 09:14 幻奇 阅读(43) 评论(0) 推荐(0)
摘要: #___author: #date: 2021/6/3#基本语法[]创建列表a = [10,20,7,15,50,15,80,1000] #创建一个空列表#用list()创建列表b = list() #创建一个空列表c = list(range(100))print(c)d = list("admi 阅读全文
posted @ 2021-07-28 09:13 幻奇 阅读(42) 评论(0) 推荐(0)
摘要: #___author: #date: 2021/6/5#元组tyuplea = (10,20,30,40)b = 10,20,30,40c =tuple([10,20,30,40])print(a,b,c)#建新列表的排序o = sorted(a) #建立新列表默认升序print(o)o1 = so 阅读全文
posted @ 2021-07-28 09:02 幻奇 阅读(50) 评论(0) 推荐(0)
摘要: # import time #定义一个时间模块# time01 = time.time() #查看时间# a="" #字符串定义# for i in range(100000): #循环遍历# a += "sxt" #添加循环的字符串# time02 = time.time() #查看结束的时间# 阅读全文
posted @ 2021-06-24 17:43 幻奇 阅读(51) 评论(0) 推荐(0)