Python 6/15 Jobs

Source: Internet
Author: User
Tags wrapper

2 Write the log adorner to implement functions such as: Once the function F1 executes, the message 2017-07-21 11:12:11 F1 Run is written to the file
Note: acquisition of time format
Import time
Time.strftime ('%y-%m-%d%x ')

Import time
def Tim (func):
def wrapper (*args,**kwargs):
Print ('%s '%time.strftime ('%y-%m-%d%x '))
return func (*args,**kwargs)
Return wrapper

3 Determine whether the following data types are iterative objects or iterators

s= ' Hello '
l=[1,2,3,4]
T= (a)
D={' a ': 1}
set={1,2,3}
F=open (' A.txt ')

4 iterate over the above objects using both dependent and non-dependent indexes, respectively

Python 6/15 Jobs

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.