DICE PROGRAM: ============= # Dice Program import random min_value = 1 max_value = 6 roll_again = "yes" while roll_again == "yes" or roll_again == 'y': print("Rolling the dice ...") print("The Values are ...") v1 = random.randint(min_value,max_value) v2 = random.randint(min_value,max_value) print(v1,v2) roll_again = input("Press 'y' or 'yes' to roll the dices again.") print("Operation is stopped.") =============================================== import random print(random.choice([100,200,300,400])) print(random.random()) # generate a float value from 0 to 1 print(random.uniform(100,200)) # can generate a float value from the given range print(random.randint(1,6)) ==================================================== Packages: ========= Modules: collection/group of variables, functions, classes etc. Package ==> like a directory collection of python files (modules) Steps for creating the package: =============================== 1) create the directory 2) Create __init__.py file into directory 3) add individual modules (python files) Importing a module into another module: ======================================= from Package_name import module-name1, module-name2,.... Module-01: =========== def additionOfTwoNumbers(x,y): s_numbers = x+y print("The Sum of Two Numbers = ",s_numbers) MOdule-02: ========== def SubOfNumbers(x,y): if x > y: sub_numbers = x - y else: sub_numbers = y - x print("The Subtraction of two numbers = ",sub_numbers) Module-03: ========== # import addition # import subtraction from Packages import addition, subtraction addition.additionOfTwoNumbers(100,123) subtraction.SubOfNumbers(97,79) Note: ==== Any module member (variable, function or class) can able to transfer from one package to another package. No possibility to transfer the members of module from directory to directory or directory to package.