Module: ======= -> module is a python file -> module consisting of classes, methods, functions etc. -> Classified into two types: 1) Inbuilt modules/pre-defined modules 2) User-defined modules/Custom modules Math Module: ============ -> Math module, consisting of pre-defined functions to perform math tasks. -> When we want to perform any math operation, we need to use "Math" module. Here, before going to use, we must import that module into our development. Syntax: import math # getting of math constatnts using math module import math print("The PI value = ",math.pi) print("Eular's Constant = ",math.e) print(math.ceil(123)) # ceil() can return the same value as output when an integer as an ainput print(math.ceil(12.234)) # ceil() can return the next integer value for the given float # print(math.ceil(12-23j)) print(math.ceil(True)) print(math.floor(123)) print(math.floor(12.234))# floor() can return the nearest integer which is less than to the givne float print(math.factorial(5)) print(math.pow(2,3)) # 2^3 print(math.sqrt(64)) print(math.sin(30)) print(math.cos(34)) print(math.degrees(30)) print(math.degrees(1)) ================================================================== Time Module =========== import time print(time.gmtime(12345678901)) # gemtime() can return current date and time when no paramter passed # to get the full date and time description based on the integer value, # time.gmtime(integer) print(time.time()) # return the current time in seconds print(time.ctime(1737732176)) # for i in range(5): # time.sleep(3) # print(i) t = time.localtime() s = time.strftime("%d",time.gmtime()) print(s) print(time.strftime("%A",time.gmtime())) print(time.strftime("%y",time.gmtime())) print(time.strftime("%m",time.gmtime())) print(time.strftime("%H",time.gmtime())) ==================================================== # Real-Time Clock import time def displayTime(): # infinite loop while True: currentTime = time.strftime("%H:%M:%S",time.localtime()) print(currentTime,end = "\r") displayTime()