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

Chapter 1

Class 11
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)
12 views4 pages

Chapter 1

Class 11
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/ 4

Chapter 1: Review of Python basic (Part 1)

Introduction of Python
Python is an interpreter, interactive, object-oriented, and high-level programming
language. It was created by Guido van Rossum in 1991 at National Research Institute
for Mathematics and Computer Science Netherlands.
Click to join telegram channel: Computer by Govind rathore

https://t.me/computer_by_govind_rathore

Python IDLE
The python IDLE tool offers an interactive and a more efficient platform to write your
code in python.

Python Modes
● Interactive Mode
● Script Mode
Different types of files in python:
.py, .pyc, .pyd, .pyo, .pyw, .pyz

Structure of a python program:


● Expressions: Expression is a combination of variables, operations and values that give a result value. Like: a+b
● Statements: Statements represent an action or command, Like print statement
● Comments: Comments are additional information provided for a statement. (#) is used for single line comment
and (‘’’ ‘’’) used for multiple line comments.
● Function: A function is a block of code which only runs when it is called.
● Blocks: A block is a piece of Python program text that is executed as a unit.

Variable:
A Variable is like a container that stores any value.
x=3, age=30
Rules for valid Variable name:

● A variable name must start with a letter or the underscore character


● A variable name cannot start with a number
● A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
● Variable names are case-sensitive (age, Age and AGE are three different variables)
● A variable name cannot contain spaces.

Multiple Assignments:

1) Assigning multiple values to multiple variables: x,y,z=2,3,4


2) Assigning same value to multiple variable: a=b=c=10

Components of Variable/Object:
A). Identity of the Variable / Object: It refers to the Variable’s memory location address which is unchanged once it has
been created. We can check memory location using this method:
id()
B). Type of the Variable / Object (data type):
int float Complex str boolean None
5 5.5 2+5j “hello” True/False None
We can seen any data type by: type()
y=”Hello”
type(y)
C). Value of the Variable/Object:
The value stored in Variable like: age=20, so 20 is the value of the variable.
L-value is age, and R-Value is 20
Data Types:
What is Dynamic Typing:
It refers to declaring a variable multiple times with values of different data types. And variable automatically changes
its data types according to data.
a=10
a=”Hello”

You might also like