Professional Documents
Culture Documents
Introduction:
Python is a popular programming language. It was created by Guido van
Rossum, and released in 1991.
It is used for:
Web development (server side)
Software development
Mathematics
System scripting
Installation of python:
Process:
Visit website python.org
Downloads click and then windows
Select version 3.6.2
Click add python 3.6 and click customize installation click next
In advance option select install for all users and click install button.
Python is recognized by ‘>>>’.
TOPIC 2: Using the python interpreter, IDLE Integrated development environment.
OBJECTIVE:
Use the python interpreter IDLE
Basic program to display the text, hello world.
Using IDLE: Extension used for python ‘.py’
INTRODUCING VARIABLES:
anyname = input(“what is your name?”)
Print(“hello world! This is “,anyname)
Where anyname variable.
NOTE:
More than one comma separated value can appear within brackets of the print
function.
A non-numeric value is included in inverted commas whereas a variable doesn’t
have inverted commas.
EX: >>> a = 20
>>>b = 10
>>> c = a*b
>>>c
200
TOPIC 3: Sailent features of python
OBJECTIVE:
History of python
Describe common features of python
Difference between 2.X and 3.X
Python is a popular high level programming language. According to TOIBE(The
importance of being earnest), python currently ranks in 4th.
Python support multiple programming parameters:-
Imperative
Procedural
Object-oriented
Functional
Python is also an open source software,many developers contribute tools
development.
Principle author: ’Guido van rossum’
Python community has given him BDFL(Benevolent dictator for life)
Identifiers:
o Keywords
o Indents
o Comments
Keywords:
Reserved words and have a predefined meaning, keywords used for
programming instruction, and they cannot be used for identifiers.
Python 3.6 has 33 keywords, Python 2 has 30 keywords, False, True,
None and Nonlocal are additional keywords.
Python 3, print is no longer a keyword but a built in function.
Comments:
Comments can be used to explain python code, comments can be used to make the code
more readable.
Comments does not have to be text that explains the code, it can also be used to prevent
python from executing code.
Comments starts with a ‘#’ and python will ignore them.
Comments can be placed at end of a line, and python will ignore the rest of the line.
EX: print(“Hello World!”) #this is a comment
Multiline comments:
Python does not really have a syntax for multi line comments, to add a multiline comment
you could insert a ‘#’ for each line.
EX: #this is a comment
#written in
#more than just one line
Print(“Hello, World!”)
Since Python will ignore string literals that are not assigned to a variable, You can add a
multiline string(triple quotes) in your code, and place your comment inside it.
EX: “ “ “
This is a comment
Written in
More than just one line”””
Print(“Hello, World!”)