exercise

2021/4/23 18:58:20

本文主要是介绍exercise,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

 

 

json.dumps(data,ensure_ascii=False,indent=4,sort_keys=True,skipkeys=True,separators=(',',': '))

try:
    b(1,0)
except Exception as e:
    logging.exception(sys.exc_info())
    # logging.error(e,exc_info=True)  # 额外使用exc_info=True参数,打印traceback信息
    
'{1!s:} {0!r:}'.format('uiop','vbnm')

names={'name':'Kevin','name2':'Tom'}
print('hello {names[name]}  i am {names[name2]}'.format(names=names))
name name2不带引号

args=['lu']
kwargs={'n1':'uiopo','n2':'vbnm'}
print('{n1} {} {n2}'.format(*args,**kwargs))
print('{:0>5}'.format(5))
print('{:x<5}'.format(5))
print('{:x^6}'.format(5))
print('{{ui {}}}'.format('uiop'))
b='ui {1:} {0:}'.format
print(b,type(b))
print(b('uiop','vbnm'))
import datetime
print('{:%Y %j %z %X}'.format(datetime.datetime.today()))
print('uiop {1:*>{0:}}'.format(10,'jkl'))
print(ascii('发明我'))
print('\u53d1\u660e\u6211')
print('{!s}'.format('发明我'))
print('{!r}'.format('发明我'))
print('{!a}'.format('发明我'))
print('{:X^+30.2f}'.format(-11.8888))

    def __getattribute__(self,item):
        return super(Employee,self).__getattribute__(item)
        return getattr(self,item)
    def __getattr__(self,item):
        return None
    
    def __getitem__(self,item):
        return super(Employee,self).__getattribute__(item)

 



这篇关于exercise的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程