Introduction to python
Introduction to python
TO PYTHON
By Saketh Tummala
What is Python?
◦ Python is a high-level computer programming language often used to build
websites and software, automate tasks, and conduct data analysis. Python is
a general-purpose language, meaning it can be used to create a variety of different
programs and isn't specialized for any specific problems
◦ It first appeared in 1991. Python 2.0 was released in the year 2000 and Python 3.0
was released in the year 2008. The language was named Python after the famous
British television comedy show Monty Python's Flying Circus, which was one of
Guido's favorite television programmes
◦ With new technologies taking the market by surprise Python has been playing a
dominant role. Whether it is cloud platform, mobile app development, BigData, IoT
with Raspberry Pi, or the new Blockchain technology, Python is being seen as a
niche language platform to develop and deliver a scalable and robust applications
Why Python is so popular?
◦ Very accessible because of its easy and understandable syntax
◦ Easy to learn
◦ Easy to use
◦ Fast and efficient
◦ Python programs can run on any platform, you can carry code created on a Windows machine and
run it on Mac or Linux
◦ Python has an inbuilt large library with prebuilt and portable functionality, also known as the
standard library
◦ Python is an expressive language Python is a free and open source
◦ Python code is about one-third of the size of equivalent C++ and Java code
How to install Python and IDE
◦ Download Python at
◦ https://www.python.org/ftp/python/3.10.5/python-3.10.5-amd64.exe (64 bit) OR
◦ https://www.python.org/ftp/python/3.10.5/python-3.10.5.exe (32 bit)
◦ Download IDE (Integrated Development Environment) at
◦ Online Compiler (https://www.programiz.com/python-programming/online-compiler) Note: Installation is not
required but the Internet is needed.
◦ IDLE (This basically gets installed into your device when you install the python software)
◦ Pycharm
◦ Microsoft Visual Code (https://code.visualstudio.com/docs/?dv=win)
◦ By setting up environment variables
◦ Anaconda
First sample program
Variables & Data types
A variable points to the value that is stored in memory. When you create a variable, the
interpreter will reserve some space in the memory to store values. Depending on the
data type of the variable, the interpreter allocates memory and makes a decision to
store a particular data type in the reserved memory. There are certain rules or naming
conventions for naming variables. The following are the rules:
Reserved keywords such as if, else, and so on cannot be used for naming variables
Variable names can begin with _, $, or a letter
Variable names can be in lower case and uppercase
Variable names cannot start with a number
White space characters are not allowed in the naming of a variable
Data types can be broadly categorized
into five different types, listed as
follows:
1. Number
2. Strings
3.Tuples
4.List
5.Dictionary
Integers VS Strings
Integers Strings
◦ The numbers are known as Integers ◦ The words and the numbers which
◦ Can be added normally as per basic are converted into integers are
known as Strings
maths
◦ Strings when added get joined
◦ Example:1+4 = 5
◦ Example: Ball is + red = Ball is red
◦ 4+5 = 45
Operators
◦ Arithmetic operators. (+, -, *, %, **)
◦ Comparison operators (<, >, !=, <>, <=, >=, ==)
◦ Assignment operators (=, +=, -=, *=)
◦ Bitwise operators (|, <<, >>, ~, &, ^)
◦ Logical operators (and, or, not)
◦ Membership operators (in, not in)
◦ Identity operators (is, is not)
Control statements
◦ The if and else statement
◦ if condition : statements-1 else: statements-2
◦ if password=="MI6": print "Welcome Mr.." else: print "Access Denied.“
◦ Indefinite
THE RANGE
FUNCTION
APPENDIX
32 bit Vs 64 bit OS
THANK YOU