Python module variables | Example code

The only global variables really have are module-scoped variables in Python. You can’t make a variable that is truly global; a variable can have a particular scope. Python module variables example Simple example code to make a module-global variable is just assigned to a name. Imagine a file called main.py, containing this single line with Read More…


Python random number | Generator | Function | Module

In Python Generating a Random Number to easily compare to other languages. For Generating a random number in python you need a random object and randint() function. You can get it from the inbuilt random module, so you have to import a Random module in the python application. In this tutorial, you will learn how to get Python Read More…


Python math module | Python import math | Function | Operators

Python maths module is a standard module and is always available in python to do mathematical operations easily. To Import math in python is to give access to the mathematical functions, which are defined by the C standard. In this tutorial, you will learn about some important math module functions with examples in python. To use Python Read More…