REMEMBER PYTHON

MINTE9
2REMEMBER




Operators

p23 ! Arithmetic operations - exponential ** / Bitwise operator - XOR ^
 
>>> 6**2 + 6
42.0
>>> 6^2
4
... 4 lines
˄˄˄
p82 ! Floor division // divides two numbers and rounds down to an integer.
 
>>> minutes = 105
>>> minutes / 60
1.75
>>> minutes // 60
1
... 5 lines
˄˄˄
 
>>> minutes = 105
>>> hours = 105 // 60
>>> remainder = minutes - hours * 60
>>> remainder
45
... 5 lines
˄˄˄
To get the remainder we can also use modulus operator.
 
>>> minutes = 105
>>> remainder = 105 % 60
>>> remainder
45
... 4 lines
˄˄˄
Task

 CompleteTask
""""
Write a function convert() that returns 
days, hours, minutes, seconds since UTC

The time module provides a function, also named time, 
that returns the current GMT in 'the epoch' """


# SOLUTION

import time
today = time.time()

def convert(t):
    ???

print(convert(today)) # 19:49:57
solution code
Questions    
No. 7   Strings
CARD
06
32

        A B C D E F
🔔
1/2