달력

5

« 2025/5 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
2020. 8. 7. 08:32

시간함수 사용하기 Python & C2020. 8. 7. 08:32

#time함수 사용하기
import time
currenttime = time.time()
totalseconds = int(currenttime)
currentsecond = totalseconds % 60
totalminute = totalseconds // 60
currentminute = totalminute % 60
totalhour = totalminute // 60
currenthour= totalhour % 24

print("현재 시간은", currenthour, "시", currentminute, "분", currentsecond, "초 입니다.",)

'Python & C' 카테고리의 다른 글

turtle  (0) 2020.08.07
for 문  (0) 2020.08.07
간단한 단위표  (0) 2020.08.07
간단한 단위 환산  (0) 2020.08.07
input  (0) 2020.08.07
:
Posted by gonlab