heure.py

Created by elnix91

Created on September 28, 2025

814 Bytes


from time import *
from math import *

print("heure()")
def heure(x=0):
  if x!=0:
    a       = int(input("heures: "))*3600
    b       = int(input("minutes: "))*60
    c       = int(input("secondes: "))
    minuit  = floor(monotonic())-(a+b+c)
  else:
    minuit  = 12759
  secondes  = floor(monotonic())-minuit

  heures    = secondes//3600
  if heures>=24:
    while heures>=24:
      heures-=24

  minutes   = secondes//60
  if minutes>=60:
    while minutes>=60:
      minutes-=60

  if secondes>=60:
    while secondes>=60:
      secondes-=60

  heures   = str(heures)
  minutes  = str(minutes)
  secondes = str(secondes)

  if len(minutes)== 1:
    minutes = "0"+minutes

  if len(secondes)==1:
    minutes = "0"+secondes

  heure_finale = heures+":"+minutes+":"+secondes
  print(heure_finale)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our cookies policy.