Python Fundamentals
Python Fundamentals
SUCHITA MISHRA
PGT(COMPUTER
SC.)
PYTHON CHARACTER
SET
⚫ Character Set is a set of valid characters that a language
can recognize.
⚫ A Character represents any letter, digit, sign, symbol.
⚫ Python has the following character set:
1. Letters: A-Z, a-z
2. Digits: 0-9
3. Special Symbols: Symbols available over
keyboard. Such as: *,?,{,}, ; , % etc.
4. White spaces: Blank space, tab space , carriage
return, newline etc.
5. Other Character: ASCII and Unicode Characters.
PYTHON
TOKENS
⚫ The smallest individual unit in a program is known as
a Token or Lexical Unit.
⚫ Python has the following Tokens:
1. Keywords
2. Identifiers
3. Literals
4. Operators
5. Punctuators/ Delimiters.
KEYWORD
Sthose words which provide
⚫Keywords are
a special meaning to interpreter.
as elif if or yield
Date_5_19 2date
_data break
file123 -*abc
a1b2c3 123file
LITERALS/
VALUES
⚫ Literals are data items that have fixed values.
⚫ Literals are often called Constant Values.
⚫ Python permits following types of literals:
1. String Literals
2. Numeric Literals
3. Boolean Literals
4. Special Literals
STRING
LITERALS
⚫ String Literal is a sequence of characters that can be a
combination of letters, numbers and special symbols
enclosed in quotation marks [single(’ ’), double(” ”)
or triple(’’ ‘’ / ””” “””) quotes ].
⚫ In python string is of 2 types:
1. Single line string:
Text= ‘Hello World’ Text= “Hello World”
2. or string:
Multi line
Text= ‘’’Hello World… or Text= “””
Hello World… How are you all!!!’ ’ How
are you all !!!”””
NUMERIC
LITERALS
⚫ Numeric Literal deals with numeric values.
⚫ In python, Numeric Literals are of 2 types:
1. Integer Literals
(-5,-8 etc..)
⚫ Binary Operator: Operators that act upon two operands are
referred to as Binary operators. Example: Addition(+),
PUNCTUATORS/DELIMITERS
⚫ Punctuators are symbols that are used in Programming
language to organize sentence structures.
⚫ Example: , ‘ “ \ ( ) { } [] etc..