#coding=utf-8 import math s = math.exp(2.) x=math.log(10000,10) print(type(x)) print(math.log10(100)) print (math.modf(-1)) import random # x = random.choice(range(20)) # print(x) # random.seed(100) # x = random.random() # print(x) # s = list(range(20)) # # random.shuffle(s) # print(s) # print(random.uniform(2,9)) #------------------2---------------- # print('1234567\a123\vqwer\rasd\nzxc\fiop') # print('qwert'.center(2)) # print('sadassadxzc'.count('a',4,9)) # import codecs # print('adasad'.encode('UTF-8','strict')) s = 'asdfgAS23s' # print (s.endswith('w',1,4)) # x=s.expandtabs(tabsize=10) # print (x,len(x)) # z = s.find('s',2,) # print(z) # print (s.format()) # print (s.index('s',3)) # print('weq'.isalnum()) # print(' 12'.islower()) # print(s.rjust(22)) # print(max('123123')) # print(s.partition('fg')) # print(s.swapcase()) # print(s.translate('ss')) import time a = time.localtime(time.time()) print(a) localtime = time.asctime( time.localtime(time.time()) ) print(localtime) print (('-')*20) print (time.strftime("%y-%m-%d %H:%M:%S", time.localtime())) print (time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())) print (time.strftime("%a %b %d %H:%M:%S %Y", time.localtime())) a = "Sat Mar 28 22:24:24 2016" print time.mktime(time.strptime(a,"%a %b %d %H:%M:%S %Y")) import calendar cal = calendar.month(2016, 1) print "以下输出2016年1月份的日历:" print calendar.calendar(2019,w=2,l=1,c=6)
07-19
11-18
11-18