상세 컨텐츠

본문 제목

타임 딜레이~~

카테고리 없음

by bumychoi 2024. 7. 9. 11:08

본문

import time
#1
for i in [0.5,1,1.5,2,2.5,3]:
   time.sleep(i)

   print(f"Delayed {i} seconds")


#2
n=0.5
while True:
    time.sleep(n)
    print(f"Delay for {n} seconds")
    n+=0.5
    if n>=3.5:
        break

#3
def sleep_out(n=1):
    print(f"dalyed for {n} seconds")
    time.sleep(n)
for n in [0.5,1,1.5,2.5,3,3.5]:
    sleep_out(n)