Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

uri beecrowd problem 1047 Game Time with Minutes

s_h, s_m, e_h, e_m = list(map(int, input().split()))
if e_h > s_h or (e_h == s_h and e_m > s_m):

    h_diff = e_h - s_h
else:
    h_diff = (e_h - s_h) + 24
    
if e_m < s_m:
    h_diff -= 1
    m_diff = (e_m - s_m) + 60
else:
    m_diff = e_m - s_m

print('O JOGO DUROU ',h_diff,' HORA(S) E ', m_diff,' MINUTO(S)', sep='',end='
')
Comment

uri beecrowd problem 1047 Game Time with Minutes

s_h, s_m, e_h, e_m = list(map(int, input().split()))
if e_h > s_h or (e_h == s_h and e_m > s_m):

    h_diff = e_h - s_h
else:
    h_diff = (e_h - s_h) + 24
    
if e_m < s_m:
    h_diff -= 1
    m_diff = (e_m - s_m) + 60
else:
    m_diff = e_m - s_m

print('O JOGO DUROU ',h_diff,' HORA(S) E ', m_diff,' MINUTO(S)', sep='',end='
')
Comment

PREVIOUS NEXT
Code Example
Python :: manipulate list using slice assignment 
Python :: raise httperror(req.full_url, code, msg, hdrs, fp) urllib.error.httperror: http error 429: too many requests 
Python :: how to run 2 async function forever 
Python :: Redirect to same page after POST method using class based views 
Python :: Convert Letters to Numbers in Python Using list comprehension 
Python :: how to use ci variables in python robot 
Python :: django qurry 
Python :: python math.trunc 
Python :: number of libraries in python 
Python :: Insertion Sorting using while in python 
Python :: pyttsx3 ichanging voices 
Python :: how to find factorial number in python 
Python :: find factors of a number using while loop 
Python :: Using python permutations function on a list with extra function 
Python :: droping columns 
Python :: sorted string dict approach 
Python :: code academy magic 8 bal code python 
Python :: python coding questions for data science 
Python :: import variables fron another file 
Python :: python evenly spaced integers 
Python :: Python NumPy atleast_1d Function Example 02 
Python :: python f strings 
Python :: Python NumPy ascontiguousarray Function Syntax 
Python :: radar chart different scales python 
Python :: python json serialize print pretty 
Python :: sorting a specific row python 
Python :: pandas use 3 columns for 2d distribution 
Python :: should either include a `queryset` attribute, 
Python :: downgrading to previous migration django 
Python :: valid paranthesis 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =