菜鸟教程 练习实例10 (python3)

题目:暂停一秒输出,并格式化当前时间。
程序分析:无。

# -*- 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()

猜你喜欢

转载自blog.csdn.net/zhangyu4863/article/details/80530973
今日推荐