Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 7

Language Fundamentals

1)Tokens :
i) Identifiers ii) literals iii) keywords iv) Operators

2)Data Types

3)Type Casting : i)Implicit and ii)Explicit

4)Python Statements
Identifier
An identifier is a name given to a variables , functions, classes having a
few letters, numbers and special characters _ (underscore).

Rules and Regulations to declare an Identifier

It should always start with a non-numeric character.


Ex : -
X2
PI
Sigma
matadd
full_name
_fun
• Python is case sensitive programming language.
d is not equal to D
t is not equal to T
rahul is not equal to Rahul
rahul is not eqaul to RAHUL
Note:
If the identifier starts and ends with two underscore symbols then
the identifier is language defined special name, which is also
known as magic methods. Eg: __init__
Which of the following are valid
Python identifiers
• 123total
• total123
• java2share
• 4ca$h
• _abc_abc_
• def
• if
• int
Literals
1) Literal is a constant assigned to the variable
i) Numeric Literals:
a) int literals Eg: b=10
b) float literals Eg: b=10.5
ii)Non Numeric Literals:
a) bool Eg: b=True
b) str Eg: s1=“gnit”
Keywords or Reserved Words
In Python some words are reserved to represent some meaning or functionality. Such
type of words are called Reserved words.
Python language uses the following keywords which are not available to users to use
them as an identifiers.

False await else import pass


None break except in raise
True class finally is return
and continue for lambda try
as def from nonlocal while
assert del global not with
async elif if or yield
Operators
An operator is a symbol that performs an operation.
• Arithmetic Operators
• Assignment Operators
• Relational Operators / Comparison Operators
• Logical Operators
• Bitwise Operators
• Ternary Operators
• Membership Operators
• Identity Operators

You might also like