This slide contains an introductory information of starting Python. I have prepared this slide to take session in my office to teach my co-workers. It helps to share knowledge and develop skill.
2.
What is Python?
− Python is a high-level, general-purpose language. The first release of
Python was 1991.
What can we do with python?
1. Unix and Linux System administration
2. Web programming with Django, TurboGears, TurboGears, Flask, Pyramid etc.
3. Artificial Intelligence
4. Scientific Research
5. Game Programming
6. Natural Language Processing
7. Image Processing
8. Machine Learning
9. etc.
4.
print “hello” # does not work in 3
3 / 2 = 1.5 # in 3
3/2=1 # in 2
3.0/2.0 = 1.5 # in 2
For more details -
− https://wiki.python.org/moin/Python2orPython3
5.
pip is a package management system used
to install and manage software packages written
in Python.
PIP stands for Pip Installs Python or PIP Installs
Packages
Pip installation
− https://pip.pypa.io/en/stable/installing/
Python Package Index
− pypi.python.org
6.
.py is the file extension
No line ending semi-colon (;)
No brackets!!!
Indentation is everything
− 4 spaces or 1 tab
# single line comment
''' multi-line
comment '''
7.
IDLE (Integrated DeveLopment Environment or
Integrated Development and Learning
Environment) is an integrated development
environment for Python
PyCharm
Sublime Text
Notepad++
12.
Python supports four different numerical types −
− int (signed integers)
− long (long integers, they can also be represented in octal and
hexadecimal)
− float (floating point real values)
− complex (complex numbers)
Here are some examples of numbers −
− Int - 10
− Long - 51924361L
− Float – 0.0
− Complex - 3.14j
13. str = 'Hello World!'
print(str) # Prints complete string
print(str[0]) # Prints first character of the string
print(str[2:5]) # Prints characters starting from 3rd to
5th
print(str[2:]) # Prints string starting from 3rd
character
print(str * 2) # Prints string two times
print(str + "TEST") # Prints concatenated string