''' Module guess.py ''' ''' A module is just a python file with functions, that can be imported into another python file. When a module is imported, all the lines in the module outside any function (lines in global scope) are executed. The functions are evalated (function objects are created) upon import, bt the functions are not called. ''' ''' Function that asks user to guess a number ''' def guess_num(n): val = 4 if n == val: print("You guessed correct") else: print("Wrong") ''' function to add 4 numbers. Accpets 4 parameters, with default values for 2 of them. Default paramters work the same way as C++. They should be at the end of the paramter list, we cannot skip paramters, etc. ''' def add4(a,b,c=19,d=2.6): return a+b+c+d ''' We don't have an explicit main function in Python. Anything is global scope is considered to be a part of main. However, we can check if control is in main using the following if statement ''' if __name__ == "__main__": myGuess = int(input("Enter your guess")) guess_num(myGuess) print("The sum is ",add4(12,4,-8,9)) print("The sum is ",add4(12,4,-8)) print("The sum is ",add4(12,4))