Python progr Module 1 final- 1BPLCK105B-2025.pdf

sureshavee 18 views 30 slides Sep 18, 2025
Slide 1
Slide 1 of 30
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30

About This Presentation

Module 1:�PYTHON: �Introduction, Variables, Expressions and Statements, Iterations and Functions
by Dr.Suresha V, VTU
2025 Scheme


Slide Content

Introduction, Variables,
Expressions and Statements,
Iterations and Functions

Simple and Readable Syntax: Python's syntax is clear and easy to

read, making it an ideal language for both beginners and experienced
programmers.
Rich Standard Library: Python has several standard libraries that
provide ready-to-use modules and functions for various tasks.
High-level Language: It is easier for humans to understand and write,
This nature makes Python suitable for rapid development and
prototyping.

. Dynamically Typed: The data types of variables are determined during
run-time. We do not need to specify the data type of a variable during
writing code.

Object-Oriented Programming (OOP) Support: Python supports OOP
paradigms, allowing developers to create reusable and moduler code
through classes and objects, encapsulation, inheritance, etc.
Interpreted Language: It means that the code is executed line by line
without the need for compilation. This enables rapid development cycles
and facilitates interactive programming.
Integrated Language: We can easily integrate it with other languages
such as C, C++, etc.
Cross-platform Compatibility: Python can be easily installed on
Windows, macOS, and various Linux distributions, allowing developers to
create software that runs seamlessly across different operating systems.
Open source and free: It is an open-source language, which means
that anyone can download it, use it, and share it. Moreover, it is free of
cost.

10. Garbage Collected: Memory allocation and deallocation are
automatically managed. Programmers do not specifically need to manage
the memory.

11. Supports GUI programming: Python has support for creating
various GUI applications. It is the most popular for making graphical
apps.

Chapter

‚ery value belongs to one data

type. In programming, a datatype is an important concept.

LE

Te

Valid variable name Invalid variable names,

current-talance (hyphens ore not allowed)
bata are not allowed)
ori bog with a number)
42 (cont begin with a number)
À character Ik $ ore nt allowed)

es ik * are not

Continue

import

Operator Example

Modulos

Chapter 3: Program Flow- Iteration

for x in ran;

rint(x,

The string "\t" represents a tab character
The backslash character in "\t" indicates the
beginning of an escape sequence

are used to

An escape sequence can appear any

string; in this example, the tab escape sequence
is the only thing in the string

The tab character shifts the cursor to the right

Until it reaches one of the tab

ı [zor ı ın
afi

break

print (1

print "

This prints:

se
print (
print ("dor

eration i the varia eration:

pat many pairs into a ist of pi

Here isa quick sample of things we can do with struct data ike this. Firs, print al the celebs

ment inside another loop

the inner loop performs all of its iterati
uter loop.

a nested loop,

Iteration of the

Example: If the outer loop is running from i = 1 to 5 and th
running from a to e. Then, for

inner loop
ch valu

loop variable (I
the inner loop will run from a t