National Institute of Engineering, Mysuru Department of Electronics and Communication Engineering Internet of Things Lab-2
National Institute of Engineering, Mysuru Department of Electronics and Communication Engineering Internet of Things Lab-2
Features of Python:
Other features:
1. Python is a fully-functional programming language that can do anything almost any other
language can do, at comparable speeds.
2. Modules are actually just Python wrappers around C/C++ code. "Modules" are pre-written
Python code that you "import" in your Python program.
3. Python can be used to make games, do data analysis, control robot and hardware,
create GUIs, or even to create websites.
1. Numbers: they store numeric values. Number objects are created when a value is
assigned to them.
To create a New file and to start programming select: File---- New File in the Integrated
DeveLopment Environment (IDLE) of python shown in Figure 2.4
n1 = 7.5
n2 = 3.9
# Add two numbers
sum = float(n1) + float(n2)
# Display the sum
print('The sum of {0} and {1} is {2}'.format(n1, n2, sum))
To run the codes go to Run and select Run module of F5 key. The output of the program
appears in Python shell shown in Figure 2.5