22csh-259-Exp 1.1
22csh-259-Exp 1.1
Experiment–I: Review of Python Basics, Data Types, Control Structures, and Functions
in Python
AIM: Implement of Python Basics : Variable, Print Statement, Commands, Data Types :
Numeric Types, string , List and Tuple , Control Structures: If, For and While, Functios:
Function Definition,Function Call,Return Statement,Default Parameters
Introduction: understanding of Python basics, data types, control structures, and functions to
build a strong foundation for programming. Let's break down these concepts and provide a
brief review for each.
1. Python Basics:
Variables: In Python, you can create variables to store and manipulate data. Variable names
are case-sensitive.
Comments: Add comments to your code using # for single-line comments or triple-quotes ('''
or """) for multi-line comments.
2. Data Types:
1
List: Ordered, mutable collection.
3. Control Structures:
If Statements:
Loops:
For Loop:
2
While Loop:
Functions in Python:
Function Definition:
Function Call:
Return Statement:
3
Default Parameters:
Viva-Voce Questions
Python Basics:
1. What is Python?
2. Explain the significance of the Zen of Python.
3. Differentiate between Python 2 and Python 3.
4. How is memory management handled in Python?
5. What are the advantages of using Python?
Data Types:
Control Structures:
4
Functions in Python: