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

Python (1 2)

This document describes 3 Python programming experiments conducted by a student to check if a number is a palindrome, check if a number is Armstrong, and determine the greatest of 3 user-input numbers. It includes the aim, code, output, and learning outcomes for each experiment. The student received marks for their performance, viva voce, and submission of a work sheet recording the experiments.

Uploaded by

Nimish Pandey
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)
16 views5 pages

Python (1 2)

This document describes 3 Python programming experiments conducted by a student to check if a number is a palindrome, check if a number is Armstrong, and determine the greatest of 3 user-input numbers. It includes the aim, code, output, and learning outcomes for each experiment. The student received marks for their performance, viva voce, and submission of a work sheet recording the experiments.

Uploaded by

Nimish Pandey
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

Experiment No. 1.

Student Name: Amleshwar UID: 22BCS80085


Branch: CSE(LEET) Section/Group : 912 - A
Semester: 4th Date of Performance:
Subject Name: Programming In Python Lab Subject Code: 21ITP259

Aim of the practical:


Python Program to check whether a given number is a palindrome.

Program Code:

num = int(input("Enter a number:"))


temp = num
rev = 0
while (num > 0):
dig = num % 10
rev = rev*10+dig
num = num//10
if (temp == rev):
print("The number is palindrome!")
else:
print("Not a palindrome!")
Output:

Aim of the practical:


Python Program to check whether entered number is Armstrong or not?

Program Code:

num = int(input("Enter a number: "))

sum = 0

temp = num
while temp > 0:
    digit = temp % 10
    sum += digit ** 3
    temp //= 10

if num == sum:
    print(num, "is an Armstrong number")
else:
    print(num, "is not an Armstrong number")

Output:

Aim of the practical:


Python program, to take three numbers from the user and print the greatest number

Program Code:

a = int(input("enter first value: "))

b = int(input("enter second value: "))

c = int(input("enter third value: "))


if a > b and a > c:

print(" greatest number is ", a)

elif b > a and b > c:

print("greatest number is ", b)

else:

print("Greatest number is", c)

Output:

Learning outcomes (What I have learnt):

1. Check whether a number is palindrome or not

2. Check if number is armstrong ?

3. Take three numbers and check which is greatest

Evaluation Grid :

Sr. No. Parameters Marks Obtained Maximum Marks


1. Student Performance 12
(Conduct of experiment)
objectives/Outcomes.
2. Viva Voce 10
3. Submission of Work Sheet 8
(Record)
Total 30

You might also like