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

22csh-259-Exp 1.1

Uploaded by

heiwa8813
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 views5 pages

22csh-259-Exp 1.1

Uploaded by

heiwa8813
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/ 5

UNIT-I

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

S/W Requirement: Python 3.11 (Install latest according to your system).

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.

Print Statement: Use the print function to display output.

Comments: Add comments to your code using # for single-line comments or triple-quotes ('''
or """) for multi-line comments.

2. Data Types:

Numeric Types: Integers (int), floating-point numbers (float).

String: Sequence of characters.

1
List: Ordered, mutable collection.

Tuple: Ordered, immutable 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:

1. Name some built-in data types in Python.


2. Explain the difference between a list and a tuple.
3. What is the purpose of a set in Python?
4. How do you convert one data type to another in Python?
5. Discuss the concept of mutability in Python.

Control Structures:

1. What is the purpose of the if statement in Python?


2. Explain the use of the elif statement.
3. What is a for loop, and how does it work in Python?
4. Differentiate between the break and continue statements.
5. How does the while loop function in Python?

4
Functions in Python:

1. What is a function in Python?


2. How is a function defined in Python?
3. Explain the difference between parameters and arguments in a function.
4. What is the purpose of the return statement in a function

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy