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

23 1 2025

The document outlines the fundamentals of the Python programming language, including its character set, tokens, and input/output statements. It explains the ASCII and UNICODE character sets, detailing their encoding and decoding processes, and defines tokens such as keywords, identifiers, data types, operators, and literals. Additionally, it provides rules for creating valid identifiers in Python, emphasizing case sensitivity and restrictions on starting characters and spaces.

Uploaded by

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

23 1 2025

The document outlines the fundamentals of the Python programming language, including its character set, tokens, and input/output statements. It explains the ASCII and UNICODE character sets, detailing their encoding and decoding processes, and defines tokens such as keywords, identifiers, data types, operators, and literals. Additionally, it provides rules for creating valid identifiers in Python, emphasizing case sensitivity and restrictions on starting characters and spaces.

Uploaded by

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

Python Language Fundamentals

1. Character set of python


2. Tokens
a. Keywords
b. Identifiers
c. Data types
d. Operators
e. Literals
3. Input and Output statements

Character set of python

Character set defines encoding and decoding standards


supported by language (OR) a group of characters support by
language.

1. ASCII
2. UNICODE

ASCII stands for American Standard Code for Information


Interchange. ASCII support 256 characters (0-255). These
characters can be,
Alphabets (a-z,A-z)
Digits (0-9)
Special characters
For every character there is an equal numeric value called ASCII
value.

Encoding is process of converting character into number into


binary
Decoding is process of converting binary into number into
character
UNICODE
UNICODE stands universal code. UNICODE support more than
1,00,000 characters. It is superset of ASCII. It support character in
English and other languages (Hindi, Telugu, …)

Tokens
Token is a smallest individual unit within program.
1. Keywords
2. Identifiers
3. Literals
4. Data types
5. Operators

Keywords
Python language related words are called keywords
Keywords are reserved words, the meaning these words are
reserved by python translator (OR) the syntax or meaning of
these words understands by python translator.
How to find list of keywords supported by python?
>>> 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']
>>> len(keyword.kwlist)
35

Python 3.13.1 support 35 keywods

Identifiers
Identifiers are user defined words or programmer defined words
Identifiers are used to identify programming elements

1. Variables
2. Functions
3. Classes
4. Constants
5. Modules
6. Packages

Identifier is user defined word. This word is created using


alphabets (A-Z,a-z),digits (0-9) and allows one special character _

Rules

1. The identifier should not be keyword

>>> x=100
>>> y=200
>>> x
100
>>> y
200
>>> pass=100
SyntaxError: invalid syntax
>>> import=1
SyntaxError: invalid syntax
>>> PASS=100
>>> PASS
100

Note: Python is case sensitive language and finds the difference


between uppercase and lowercase

2. Identifier should not start with digit. It can start with


alphabet or _

>>> _a=100
>>> _a_=200
>>> _=300
>>> __=400
>>> _a
100
>>> _a_
200
>>> _
300
>>> __
400
>>> amt$=100
SyntaxError: invalid syntax
>>> $amt=100
SyntaxError: invalid syntax

3. There should not be any space between identifier

>>> student rollno=1


SyntaxError: invalid syntax
>>> student fee=9000
SyntaxError: invalid syntax
>>> student_rollno=1
>>> student_rollno
1
4. The maximum length of identifier can be unlimited

>>> a=10
>>> a
10
>>> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa=100
>>> aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
100

5. Identifier can be defined in upper case or lowercase

>>> A=100
>>> a=200
>>> A
100
>>> a
200

You might also like