0% found this document useful (0 votes)
5 views18 pages

Suagnth Py Lab

Uploaded by

suganthr09
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)
5 views18 pages

Suagnth Py Lab

Uploaded by

suganthr09
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
You are on page 1/ 18

PYTHONLABREPORT

Date : 17.10.2024

Course Title : 24Z110 Python Programming Lab

Student Name : SUGANTH V

Roll Number : 24Z368

Exercise No : 1

1. Problem Statement:

Program to check if a number is positive or negative or zero.

2. Logic :

The logic is to find if a number is positive or negative or zero by using


if-else statement.

3. Program :
Exercise No : 2

1. Problem Statement:

Program to check whether a number is even or odd.

2. Logic :

If the number is divisible by 2, then the number is even. Else, the


number is odd.

3. Program :

4. Output:
Exercise No : 3

1. Problem Statement:

Program to find the largest of three numbers.

2. Logic :

Comparing the values of three numbers and deciding which is the


largest among them using if-else logic.

3. Program :

4. Output:
Exercise No : 4

1. Problem Statement:

Program to calculate the Simple Interest value.

2. Logic :

Multiply the values of Principal Amount, Rate of interest, Time Period


and divide it by 100 to calculate the value of Simple Interest.

3. Program :
4. Output:

Exercise No : 5
1. Problem Statement:

Program to calculate the factorial of a number.

2. Logic :

To find the value of factorial of the given number by using if-else logic
and while loop.
3.

4. Output:
Exercise No : 6

1. Problem Statement:

To Calculate the sum of natural numbers.

2. Logic:

To find the sum of the natural numbers using while loop.

3. Program :

4. Output:

Exercise No : 7

1. Problem Statement:

To print the multiplication table of a given number.


2. Logic:

To print the multiplication table of the input number by using basic


arithmetic operators.

3. Program :

4. Output:

Exercise No : 8

1. Problem Statement:

Program to print the star pattern.


2. Logic:

To print the star pattern using the nested for loop.

3. Program :

4. Output:

Exercise No : 9

1. Problem Statement:

To print the Fibonacci Sequence.

2. Logic:

To print the Fibonacci Sequence of numbers up to the limit entered


by the user using while loop.

3. Program :
4. Output:

Exercise No : 10

1. Problem Statement:

Program to check whether a number is prime or not.

2. Logic:

To check whether a number is prime or not using if-else logic.


3.

4. Output:

Exercise No : 11

1. Problem Statement:

Program to check whether a given year is a leap year or not.

2. Logic:

To check if the input year is a leap year or not using if else logic.

3. Program :
4. Output:

Exercise No : 12

1. Problem Statement:

Program to reverse a given number.

2. Logic:

To reverse a given number using while loop.

3. Program :

4. Output:
Exercise No : 13

1. Problem Statement:

To Check if a number is an Armstrong Number or not.

2. Logic:

To check whether a number is Armstrong or not using For loop and if-
else statement.

3. Program :

Exercise No : 14
1. Problem Statement:

To calculate the sum of digits.

2. Logic:

To calculate the sum of the digits of a number using while loop

3. Program :

4. Output:

Exercise No : 15

1. Problem Statement:

Problem to Count the number of digits in a number.

2. Logic:

To Count the number of digits in a number using while loop.


3. Program :

4. Output:

Exercise No : 16

1. Problem Statement:

Program to check whether the given number is palindrome or not

2. Logic:

To check if the input number is palindrome or not using while loop


and if-else statement.

3. Program :
4. Output:

Exercise No : 17

1. Problem Statement:

To calculate the LCM of two numbers.

2. Logic:

To find the LCM of two numbers using math package.

3. Program :
Exercise No : 18

1. Problem Statement:

To Calculate the sum of even numbers.

2. Logic:

To find the sum of even numbers by defining a function.

3. Program :

4. Output:
************************************************

You might also like