0% found this document useful (0 votes)
2 views6 pages

Python

The document outlines three experiments focused on fundamental Python programming concepts. Experiment 1 covers the use of the print() function for displaying output, Experiment 2 explains how to take user input with the input() function, and Experiment 3 discusses conditional statements and loops for controlling program flow. Each section includes aims, theoretical explanations, and examples to illustrate the concepts.

Uploaded by

ankurpatil9876
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views6 pages

Python

The document outlines three experiments focused on fundamental Python programming concepts. Experiment 1 covers the use of the print() function for displaying output, Experiment 2 explains how to take user input with the input() function, and Experiment 3 discusses conditional statements and loops for controlling program flow. Each section includes aims, theoretical explanations, and examples to illustrate the concepts.

Uploaded by

ankurpatil9876
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment 1: Print Function in Python

❖ Aim:
To understand and use the print() function in Python for
displaying output.

❖ Theory:
The print() function in Python is used to display output on the
screen. It can print strings, numbers, variables, and formatted
text. The function supports multiple arguments, escape
sequences, and formatted output.

➢ Examples:
Experiment 2: Taking input from User

❖ Aim:
To learn how to take user input in Python using the input()
function and display the result.

❖ Theory:
The input() function in Python is used to take user input from
the keyboard during program execution. By default, it captures
input as a string, but it can be converted to other data types
like integers and floats using type casting. This function is
useful for making interactive programs where users can
provide data dynamically.

➢ Examples:
Experiment 3:Conditional Statements and Loops

❖ Aim:
To understand and implement conditional statements (if-else) and
loops (for, while) in Python.
❖ Theory:
Conditional statements (if, elif, else) are used to make
decisions in a program based on given conditions. Loops (for,
while) allow repeated execution of a block of code based on
conditions or sequences.
The if-elif-else structure helps execute different code blocks
depending on conditions.
The for loop is used for iterating over sequences such as lists
or ranges.
The while loop continues execution as long as the condition
remains true.
Loop control statements like break and continue help modify loop
behaviour.

➢ Examples: if-else & elif


➢ Examples: Using Loops
➢ Examples: Using Break & Continue keyword

You might also like