Module 1:�PYTHON: �Introduction, Variables, Expressions and Statements, Iterations and Functions
by Dr.Suresha V, VTU
2025 Scheme
Size: 2.39 MB
Language: en
Added: Sep 18, 2025
Slides: 30 pages
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