Quick actions

cmd+k|ctrl+k

Navigation

Languages

Första tredjedelen

Snippet info

Language

Python

Visibility

public

Author

kaniaslan27

Created

2022-12-29T12:12:05.500384Z

Updated

2023-04-07T12:16:01.988891Z

a = float(input ("Write down the time of maghrib "))

b = float(input("Write down the time of fajr "))

#Antalet timmar i minuter respektivt minuter i heltal för maghrib
c = (int(a)) *60
d = ((a%1) *100)

#Antalet timmar för fajr multiplicerat för minuterna respektivt antalet fajrs minuter
e = (int (b) +24) *60
f = int((b%1) *100)

#Hur många minuter det är från maghrib till isha /3
g = (e+f-c-d)/3

#timmen för slut 1/3
h = int((g+c+d)/60)

i = (((g)/60)%1)

j= int((i*60)+d)

jag = j

if j > 59:
  jag = j-60
  j = j-60

if j > 9:
  print(f'The time for the end of the first third of the night is {h}:{jag}')

if j < 1:
  jag = "00"
  j = j+11
  print(f'The time for the end of the first third of the night is {h}:{jag}')

if j < 10:
  print(f'The time for the end of the first third of the night is {h}:{0}{jag}')


#Hur många minuter det är från maghrib tills andra tredjedelen av natten
gres = g*2

#Sluttimmen av 2/3 av natten
hest = int((gres+c+d)/60)

if hest >= 24:
    hest = hest-24

#Hur många minuter in på timmen
iglo = (((gres)/60)%1)
jogga = int((iglo*60)+d)

jagare = jogga

if jogga > 59:
    jagare = jogga-60
    jogga = jogga-60

if jogga > 9:
    print(f'The time for the last third of the night ends after (I recommend you to wait extra minutes) {hest}:{jagare}')

if jogga < 1:
    jagare = "00"
    jogga = jogga+11
    print(f'The time for the last third of the night ends after (I recommend you to wait extra minutes) {hest}:{jagare}')

if jogga < 10:
    print(f'The time for the last third of the night ends after (I recommend you to wait extra minutes) {hest}:{0}{jagare}')
INFO