Posts

Showing posts with the label packages

8.Built-in Functions, Modules and Packages

  Built-in Functions A function is a named sequence of statement(s) that performs a computation. It contains line of code(s) that are executed sequentially from top to bottom by Python interpreter.They are the most important building blocks for any software development in Python. Built in functions are the function(s) that are built into Python Standard Library  and can be accessed directly.Functions usually have arguments and return a value. Some built in functions are given below with examples. Refer python documentation for more details. https://docs.python.org/3.8/library/functions.html abs(x) returns the absolute value of x . abs(-45) will return 45 max(x,y,z) returns the maximum of x,y,z . max(10,20,30) will return 30 min(x,y,z) returns the minimum of x,y,z . min(10,20,30) will return 10 divmod(x,y) returns both the quotient and remainder . divmod(14,5) will return (2,4) cmp(x,y) returns 0 if x==y , 1 if x>y and -1 if x<y round(x,n) round x to n digits. round(3.14567,2) wil