0% found this document useful (0 votes)
35 views5 pages

Class 4

The document discusses Python versions, data types in Python, operators in Python, modules in Python, and identifiers and keywords in Python. It states that Python 1.0 was introduced in 1994, Python 2.0 in 2000, and Python 3.0 in 2008. It lists the main data types as integer, string, float, and provides examples. It describes different types of operators in Python including arithmetic, relational, logical, bitwise, and assignment operators. It discusses built-in and third-party modules. It outlines the rules for defining identifiers in Python and lists Python's reserved keywords.

Uploaded by

kunala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views5 pages

Class 4

The document discusses Python versions, data types in Python, operators in Python, modules in Python, and identifiers and keywords in Python. It states that Python 1.0 was introduced in 1994, Python 2.0 in 2000, and Python 3.0 in 2008. It lists the main data types as integer, string, float, and provides examples. It describes different types of operators in Python including arithmetic, relational, logical, bitwise, and assignment operators. It discusses built-in and third-party modules. It outlines the rules for defining identifiers in Python and lists Python's reserved keywords.

Uploaded by

kunala
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

python version:-

python 1.0v introduced in jan 1994


python 2.0v introduced in oct 2000
python 3.0v introduced in dec 2008i.Insertion order are preseved.
ii.hetrogeneous object are allowed.
iii.duplicates are allowed.
iv.Growable in nature.
v.values should be enclosed within squre bracket.1.Arithmetic Operators
2.Relational or comparision operatos
3.Logical OperatosNote:- raw_input function of python 2 is renamed as input()
function in python3.
Methods of dictionary:-
clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault',
'update', 'values']
But in python3 we have only input() method and eaw_input() method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


codule:- Module is a part of python program,there are 2 type of module
2n-built module(os,sys,math etc)
2rd party module(pandas,numpy,scipy,matplotlib etc)
4.Bitwise Operatorsex:-
x = eval(input('First number:'))Note:- But in python3 we have only input() method
and eaw_input() method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


Methods of dictionary:-
clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault',
'update', 'values']
But in python3 we have only input() method and eaw_input() method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.

y = eval(input('second number'))
print(x+y)
But in python3 we have only input() method and eaw_input() method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.

india nai tiobk batuibkeej ubd indian arngudfoaoddofhsdsoihfodhfvx jjsddgf

10--->int
'scodeen'--->str
10.5--->float

Note:- But in python3 we have only input() method and eaw_input() method is not
available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.

Output:-

we can write print() function to display output


5.Assignment Operatosindia nai tiobk batuibkeej ubd indian
arngudfoaoddofhsdsoihfodhfvx jjsddgf
10--->int
'scodeen'--->str
10.5--->float
in python3 we have only input() method and eaw_input() method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


Operators:-

Operator is a symbol that performs certain operation,


Python proviede many operatos.

1.Arithmetic Operators
2.Relational or comparision operatos
3.Logical Operatos

Note:- But in python3 we have only input() method and eaw_input() method is not
available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


Methods of dictionary:-
clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault',
'update', 'values']

1,clear:- Removes all element from the dictionary.

>>> s = {101:'Tushar',102:'Balaji',103:'Rupali'}
>>> s.clear()
>>> s
{}
10--->int
'scodeen'--->str
10.5--->float

ex:-
l = [10,56.87,7+9j,True,'string',[1,2,3,4],10]
>>> l
[10, 56.87, (7+9j), True, 'string', [1, 2, 3, 4]]
>>>

current versionNote:- But in python3 we have only input() method and eaw_input()
method is not available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


Operators:-

Operator is a symbol that performs certain operation,


Python proviede many operatos.
Note:- But in python3 we have only input() method and eaw_input() method is not
available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


Methods of dictionary:-
clear', 'copy', 'fromkeys', 'get', 'items', 'keys', 'pop', 'popitem', 'setdefault',
'update', 'values']

1,clear:- Removes all element from the dictionary.

>>> s = {101:'Tushar',102:'Balaji',103:'Rupali'}
>>> s.clear()
>>> s
{}

1.Arithmetic Operators
2.Relational or comparision operatos
3.Logical Operatos
4.Bitwise Operators
5.Assignment Operatos
6.Special Operator.

python 3.9.5 10--->int


'scodeen'--->str
10.5--->float

Note:- But in python3 we have only input() method and eaw_input() method is not
available.

python 3 input() function behaviour exactly same as raw_input() method of py2 that
is every input value is treated as str type only.

Note:- raw_input function of python 2 is renamed as input() function in python3.


pyton 2.7.13

1.For developing Desktop application.


2.For developing web app.
3.For developing database app.
4.For Network programming.
5.For developing games.
6.Fotr Data analysis application and data science.
7.For machine learning.
8.For AI(Artificial Inteligence) app.
9.Fot IOT(Internet of things)
Limitation of python.

Identifiers

A name in python program is called identifiers.


It can be class name or function name or module name or variable name.

a = 10

class BankingProject:

def system_config:

Rules to define identifiers in python:-

1. The only allowed characters in python are

i. alphabet symbols(either lower case or upper case)


ii. digits(0 to 9)
iii. underscore symbol(_)

2.Indentifiers should not starts with digit

total123=(correct)
123total =(wrong)

3.Indentifiers are case sensitive . of course python lang. is case sesitive lang.

total = 10
TOTAL = 99
print(total)#10
print(TOTAL)#99

4.Dollar($) symbol is not allowed in python.

5.There is no length limit python indentifiers,but not recommended to use too


lengthy indentifiers.

6. using underscore symbols:-

x = 10 (normal variable)
_x = 10(procted variable)
__x = 10 (private variable)
___x = 10 (magic variable)

Reserved words or keywords

In python some words are reserved to represent some meaning or functionality. such
type of words are called Reserved words. There are 35 words are reserved in python.

'False', 'None', 'True','and', 'as', 'assert', 'async', 'await', 'break', 'class',


'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from',
'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass',
'raise', 'return', 'try', 'while', 'with', 'yield'
Note:-
1.we can not use variable or class or function or module name as a keywords name.

ex:-True = 10(worng)'
2.All Reserved words in python contain only alphabet symbols.

3.Excepts the True,False,None 3 reserved words ,all contains only lower case
alphabets symbols.

process of keywords

import keyword
keyword.kwlist

'False', 'None', 'True','and', 'as', 'assert', 'async', 'await', 'break', 'class',


'continue', 'def', 'del', 'elif', 'else', 'except', 'finally', 'for', 'from',
'global', 'if', 'import', 'in', 'is', 'lambda', 'nonlocal', 'not', 'or', 'pass',
'raise', 'return', 'try', 'while', 'with', 'yield'

You might also like