题目:暂停一秒输出,并格式化当前时间。
程序分析:无。
# -*- coding:utf-8 -*-
import time
def main():
print(time.strftime('%y-%m-%d %H:%M:%S', time.localtime(time.time())))
# 暂停一秒
time.sleep(1)
print(time.strftime('%y-%m-%d %H:%M:%S', time.localtime(time.time())))
main()