0% found this document useful (0 votes)
12 views7 pages

Notes IP-Chapter - 3 Python Fundamentals

Uploaded by

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

Notes IP-Chapter - 3 Python Fundamentals

Uploaded by

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

ACADEMIC YEAR 2025-2026

Notes (Chapter-3)

Python Fundamentals
Grade : 11 Subject : Informatics Practices

KWL Chart:

K: What I KNOW W: What I WANT to Know L: What I LEARNED


Python is a What characters and
Python uses a specific character
programming symbols are used in
set including symbols and letters.
language. Python?
I have used print() to What are tokens and why Tokens are the basic building
show output. are they important? blocks of Python code.
Variables can store How do I assign multiple Learned to use multiple and
values. values at once? chained assignments.
I know how to take What is dynamic typing in Python allows changing variable
input using input(). Python? types at runtime.
Programs follow a What is the basic structure Python programs start with
sequence. of a Python program? comments, followed by logic.
Learning Objectives

1. Identify characters used in Python (character set).


2. Recognize Python tokens (keywords, identifiers, literals, operators, punctuators).
3. Understand the basic structure of a Python program.
4. Declare and assign values to variables.
5. Use multiple assignments and understand dynamic typing.
6. Use input() and print() for user interaction.

Extended Learning:

▪ Python Character Set :- Character set is a set of valid characters that


a language can recognize.
A character represents any letter, digit or any other symbol. Python
supports Unicode encoding standard.
Eg-
Letters A-Z, a-z
Digits 0-9
Special symbols Space + -* / ** \()[ ] { }//=! = == <, > . ‘ “” , ; :%
!$#
(1)
<= >= @ _ (underscore)

Whitespaces Blank space, tabs , new line


Other Python can process all ASCII and
characters Unicode
Character as part of data or literals.

▪ Token – The smallest individual unit in a program is known as a Token


• Keywords – Are the words that convey a special meaning to the language
compiler
o These are reserved for special purpose and must not be
used as normal identifier.
o Eg- False, del, in, or, while , for, print etc
▪ Identifiers- Are fundamental building blocks of a program and are
used as the general terminology for the names given to different parts
of the program eg variables, objects , classes, functions, arrays etc.
✓ Identifiers can have alphabets, digits and underscore
and Doller sign characters.
✓ They must not be a keyword or Boolean literal or null literal
✓ They must not begin with digit.
✓ They can be of any length.
✓ P y t h o n is case sensitive i.e upper-case letters and
lower-case letters are treated differently.

Conventions

✓ The names of public methods and instance variables


should begin with a lower case letter.
Eg maximum sum

✓ For names having multiple words, second and subsequent


words beginning character is made capital so as to enhance
readability eg avgSalaryOfEmployees
✓ Private and local variables should use lower case letters eg
width, results, final_score
✓ Class names and interface names begin with an upper case
letter eg Employee

✓ The constants should be named using all capital letters and


underscores eg MAX_VALUE, MAX_MARKS, SPECIAL_SALARY,
TOTAL

(2)
▪ Literals(CONSTANT)
✓ Literals (often referred to as constants) are data items that
are fixed data values.
✓ Python allow several kinds of literals (i) String literals (ii)Numeric literals
(iii)Boolean literals
(iv)Special Literal None (v)Literal Collections

▪ Punctuators are symbols that are used in programming languages


to organize programming –sentence, structures and indicate the
rhythm and emphasis of expressions, statements and program
structure. eg ( ) {} [ ] . ,

▪ OPERATORS The operations (specific tasks)are represented by


operators and the objects
of the operations(s) are referred to as operands eg arithmetic
Operators,
Relational Operators, Logical Operators, Assignment Operators,
Conditional Operator ?
o “Operators are token that trigger some computation / action
when applied to variables and other objects in an expression.

Unary Operators
+ Unary plus
- Unary minus
~ Bitwise complement
not Logical negation
Binary Operators
+,-,*,/,%,**,// Addition,Subtraction,Multiplication,Division,Remainder/Modulus,**
exponent, floor division

Bitwise Operators
& , ^, | Bitwise AND, Bitwise exclusive OR(XOR) Bitwise OR
Shift operators
<< Shift left
>> Shift right
Identity operators
Is , is not Is the identity same ? , is the identity not same?
Relational operators
<, >, <=,>=,==,!= Less than, greater than, less than or equal to, Greater than or
equal to, equal to, not equal to
Logical operator
AND, OR Logical AND , Logical OR
Assignment operators
(3)
=,/=,+=,*=,%=,- Assignment , Assign quotient , Assign sum, Assign product,
=,**=,//= Assign remainder, Assign difference, Assign Exponent , Assign
Floor division
Membership operators

In , not in Whether variable in sequence , whether variable not in


sequence

(i) Expressions---An expression is any legal combination of


symbols that represents a value.
Eg {15 ,2.9 } This is an expressions that are values only
A+5 ,
(3+5)/4
These are complex expressions that produce a value when evaluated
(ii) Statement – A statement is a programming instruction that does
something
i.e some action takes place. Eg print(“Hello”)
(iii) Comments- Comments are the additional readable
information to clarify the source code. Comments in Python
begin with symbol # and generally end with end of the physical
line.
(iv) Functions – A function is a code that has a name and it can be
reused(executed again) by specifying its name in the program,
where needed.
(v) Blocks and Indentation- “A group of statements which are part
of another statement or a function are called block or code –
block or suite in Python.”

• Variables - Named labels , whose values can be used and processed


during program run, are called variables.
• Variable creation :- Python variables are created by assigning value
of desired type to them, eg to create a numeric variable, assign a
numeric value to variable_name ; to create a string variable, assign
a string value to variable_name and so on.
Eg Student
=’Jacob’
Age
=16
Lvalues and Rvalues---Lvalues are the objects to which we can assign a
value or expression. Lvalues can come on LHS of an assignments statement.

(4)
Rvalues are the literals and expressions that are assigned to Lvalues. Rvalues
can come on RHS of an assignment statement.

• Multiple Assignments – a=b=c=10 , x,y,z=10,20,30


• Variable definition---a variable is defined only when we assign
some value to it. Using an underdefined variable in an expression
/statement causes an error called NameError.

Dynamic Typing –“A variable pointing to a value of a certain type , can be made to
point to a value/object of different type. This is called Dynamic Typing.

Example :

X=10 Here variable X is fist pointing to /referring to an


integer value 10 and then to a string value “UAE” . Here
variable X does not have a type but the value it points
Print(x) to does have a type. So we can make a variable point to
a value of different type by reassigning a value of that
type.
X=” UAE”

• Simple Input and output—To get input from user interactively, we


can use built –in function input().

>>> name=input(“Enter your Name” >>> marks=input(“Enter marks:”)

Enter your name= John Enter marks :89

Program to obtain three numbers and print their sum

# to input 3 numbers and print their sum

Num1=int(input(“Enter number 1:”))

Num2=int(input(“Enter number2:”))

Num3=int(input(“Enter number3:”))

(5)
Output

Enter number1: 7

Enter number2:3

Enter number3:13

Program to obtain Swap two numbers

# to Swap values of two numbers

a=int(input(“Enter value of a”))

b=int(input(“Enter value of b”))

a,b=b,a

print(“a=”, a,” b=”,b)

OUTPUT:

Enter value of a 10

Enter value of b 20

a=20 b=10

Real Life Application:

Python basics help students create simple programs like calculators, quizzes, or input
forms, useful in school projects and daily tasks.
National Identity Mark (NIM):

(6)
Domain 3 : Citizenship
Subdomains: 3.1 Belonging, 3.3 Conservation

Connection:
While learning Python fundamentals, students can create small programs (e.g., data
input forms or environmental calculators) that promote awareness about UAE-specific
topics such as water conservation, energy use, or local traditions. This fosters a sense
of belonging and responsibility toward their nation and environment.

Student’s/Parent’s Reflection:

Teacher’s Remark:

(7)

You might also like