입력 : 53457
출력 : 14시 50분 57초
나누기 기호(/)를 두번 입력하시면 소숫점을 버린 값이 나옵니다.
time = int(input("자정부터 경과 시간을 초 단위로 입력 :"))
hours = int(time / 3600) # 14.849166666666667
minutes = int(time / 60 % 60) # 50.950000000000045
seconds = int(time % 60) # 57
print(f"현재 시각= {hours:.0f} 시 {minutes:.0f} 분 {seconds} 초")
import turtle
t = turtle.Turtle()
wn = turtle.Screen()
wn.bgcolor("light green")
t.color("red")
t.shape("arrow")
t.forward(200)
t.right(144)
t.forward(200)
t.right(144)
t.forward(200)
t.right(144)
t.forward(200)
t.right(144)
t.forward(200)
t.right(144
turtle.mainloop()
turtle.bye()
'과제' 카테고리의 다른 글
[과제6] (0) | 2022.05.18 |
---|---|
[과제5] 냉장고에 음식 넣었다 빼기, 로또 걸리게 해주세요 (2) | 2022.04.14 |
[과제4] 역수의 합 구하기, 별 찍기 (0) | 2022.04.14 |
[과제3] 윤년 계산, 소수 판별 (0) | 2022.04.14 |
[과제1] 두 점의 중심점과 두 점 사이의 거리 구하기 (0) | 2022.04.14 |