final-pps-program_FE-2023-24_MTJ (1)
final-pps-program_FE-2023-24_MTJ (1)
PRACTICAL NO - 01
Title : To calculate salary of an employee given his basic pay (take as input from
user). Calculate gross salary of employee. Let HRA be 10 % of basic pay and TA be
5% of basic pay. Let employee pay professional tax as 2% of total salary. Calculate
net salary payable after deductions.
Program :
Input :
basic = int(input("ACCEPT BASIC SALARY OF EMPLYOEE : ")) //30000 as input
Output :
30810.0
PRACTICAL NO - 02
Title : To accept an object mass in kilograms and velocity in meters per second and
display its momentum. Momentum is calculated as e=mc2 where m is the mass of
the object and c is its velocity.
Program :
Input :
mass = float(input("ENTER MASS(in Kg) : "))
print('MOMENTUM IS :',momentum)
Output :
ENTER MASS(in Kg) : 12
MOMENTUM IS : 13872.0
PRACTICAL NO - 03
Title : To accept N numbers from user. Compute and display maximum in list,
minimum in list, sum and average of numbers.
Program :
Input :
N = int(input("Do you want how many number of Input Element : "))
data=[ ]
for i in range(N):
data.append(n)
print("Average : ",sum(data)/N)
Output :
ENTER ELEMENT : 55
ENTER ELEMENT : 22
ENTER ELEMENT : 88
Maximum : 88
Minimum : 22
Sum : 165
Average : 55.0
PRACTICAL NO - 04
Title : To accept student’s five courses marks and compute his/her result. Student
is passing if he/she scores marks equal to and above 40 in each course. If student
scores aggregate greater than 75%, then the grade is distinction. If aggregate is
60>= and <75 then the grade if first division. If aggregate is 50>= and <60, then the
grade is second division. If aggregate is 40>= and <50, then the grade is third
division.
Program :
Input :
m1 = int(input("ENTER THE FIRST SUBJECT MARKS : "))
m2 = int(input("ENTER THE SECOND SUBJECT MARKS : "))
m3 = int(input("ENTER THE THIRD SUBJECT MARKS : "))
m4 = int(input("ENTER THE FOURTH SUBJECT MARKS : "))
m5 = int(input("ENTER THE FIFTH SUBJECT MARKS : "))
per = int((m1+m2+m3+m4+m5))/5
print("PERCENTAGE IS :", int(per))
print("DISTICTION!!!")
else:
print("FAILED. .... !!!!")
Output1 :
PERCENTAGE IS : 33
Output2 :
PERCENTAGE IS : 77
DISTICTION!!!
PRACTICAL NO – 05(A)
Title : To check whether input number is Armstrong number or not. An
Armstrong number is an integer with three digits such that the sum of the cubes of
its digits is equal to the number itself. Ex. 371.
Program(Basic) :
Input :
num = int(input("ENTER THE 3 DIGIT ELEMENT :"))
num_original = num
rem1 = num%10
num = num // 10
rem2 = num%10
rem3 = num // 10
if result == num_original:
else:
Output-1 :
ENTER THE 3 DIGIT ELEMENT :371
IT IS ARMSTRONG NUMBER
Output-2 :
ENTER THE 3 DIGIT ELEMENT :534
PRACTICAL NO – 05(B)
Title : To check whether input number is Armstrong number or not. An
Armstrong number is an integer with three digits such that the sum of the cubes of
its digits is equal to the number itself. Ex. 371.
Program(Modified) :
Input :
num_original = num
rem1 = num%10
num = num // 10
rem2 = num%10
rem3 = num // 10
if result == num_original:
else:
Output1 :
ENTER THE 3 DIGIT ELEMENT :371
IT IS ARMSTRONG NUMBER
Output2 :
ENTER THE 3 DIGIT ELEMENT :534
PRACTICAL NO – 06
Title : To simulate simple calculator that performs basic tasks such as addition,
subtraction, multiplication and division with special operations like computing xy
and x!.
Program :
Input :
x = int(input("ENTER VALUE OF X :"))
y = int(input("ENTER VALUE OF Y :"))
result=1
for n in range(y):
result = result * x
result=1
result = result * n
print("THE X! =",result)
Output :
ENTER VALUE OF X :5
ENTER VALUE OF Y :3
THE ADDITION IS: 8
SCOE Nashik
Programming and Problem Solving Laboratory (PPSL) FE- 2019 Pattern
PRACTICAL NO – 08
Title : To accept two numbers from user and compute smallest divisor and
Greatest Common Divisor of these two numbers.
Program :
Input :
while y!=0:
(x,y)=(y, x%y)
print("GCD IS :",x)
print("SCD 1")
Output-1 :
ENTER VALUE OF X :12
ENTER VALUE OF Y :3
GCD IS : 3
SCD 1
Output-2 :
ENTER VALUE OF Y :5
GCD IS : 1
SCD 1
SCOE, Nashik
Programming and Problem Solving Laboratory (PPSL) FE -2019 Pattern
PRACTICAL NO – 09
Title : To accept a number from user and print digits of number in a reverse order.
Program :
Input :
while num!=0:
print(num%10, end="")
num = num // 10
print()
Output :
ENTER THE NUMBER :123
THE REVERSE OF NUMBER IS : 321
Programming and Problem Solving Laboratory (PPSL) FE -2019 Pattern
PRACTICAL NO – 10
Title : To input binary number from user and convert it into decimal number.
Program :
Input :
dec = 0
Output-1:
ENTER THE BINARY NUMBER :1111
DECIMAL NUMBER IS : 15
Output-2:
ENTER THE BINARY NUMBER :1010
DECIMAL NUMBER IS : 10
Programming and Problem Solving Laboratory (PPSL) FE -2019 Pattern
PRACTICAL NO – 14
Title : To accept from user the number of Fibonacci numbers to be generated and
print the Fibonacci series.Program :
Input :
n1 = 0
n2 = 1
count = 0
Output :
HOW MANY TERMS :10
FIBONAACI SEQUENCE UPTO TERM 10 :
0,1,1,2,3,5,8,13,21,34,
Programming and Problem Solving Laboratory (PPSL) FE -2019 Pattern
PRACTICAL NO – 15
Title : Write a python program that accepts a string from user and perform
following string operations- i. Calculate length of string ii. String reversal iii.
Equality check of two strings iii. Check palindrome ii. Check substring
Input :
s = input("ENTER FIRST STRING :")
print("Length is :",len(s))
print("Reverse is :",s[::-1])
print("Palindrome is :",s == s[::-1])
t = input("\nENTER SECOND STRING :")
print("String Equal is :",s==t)
print("Substring present from :",s.find(t))
Output :
ENTER FIRST STRING :madam
Length is : 5
Reverse is : madam
Palindrome is : True
PRACTICAL NO – 16
Title : Write a python program that accepts a string from user and perform
following string operations- i. Calculate length of string ii. String reversal iii.
Equality check of two strings iii. Check palindrome ii. Check substring
Program :
Input :
file1 = open("myfile.txt")
data = file1.read()
data = data.replace(".",".")
data = data.swapcase()
file2 = open("myfile.txt","w")
file2.write(data)
file1.close()
file2.close()
print("Task Completed")
Output :
Hi, welcome to SCOE, Nashik.
*******************BEST OF LUCK***************