Python3 second
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python3 second相关的知识,希望对你有一定的参考价值。
#List append list= [‘a‘,‘b‘,‘c‘,‘d‘,‘e‘,‘f‘,‘g‘] print(list) list.append(‘h‘) print(list) list2= [‘1‘,‘2‘,‘3‘,‘4‘,‘5‘,‘6‘,‘7‘,‘6‘] list.extend(list2) print(list) list.insert(0,‘x‘) print(list) list.remove(‘x‘) #remove value print(list) list.pop(0) print(list) print(list.index(‘e‘)) print(list.count(‘6‘)) print(list.count(6)) list.reverse() print(list) list.pop() print(list) list.pop() print(list) list.pop() print(list) squares =[] for x in range(10): squares.append(x**2) print(squares) [print(x*2) for x in squares if x >0] import time time1="20071011" time2="20071012" t1 = time.strptime(time1, "%Y%m%d") t2 = time.strptime(time2, "%Y%m%d") print( t1 < t2) import datetime today = datetime.date.today() print(today.strftime(‘%Y%m%d‘)) basket = {‘apple‘, ‘orange‘, ‘apple‘, ‘pear‘, ‘orange‘, ‘banana‘} print(basket) tel = {‘jack‘:4390,‘huang‘:1216} print(tel) print(tel[‘jack‘])
以上是关于Python3 second的主要内容,如果未能解决你的问题,请参考以下文章