实现一个方法,每隔一秒输出1,2,3,4,5 可以使用Python实现这个功能,代码如下: import time def print_numbers(): for i in range(1, 6): print(i) time.sleep(1) print_numbers()