Python 1.2 KushagrJain
Python 1.2 KushagrJain
WORKSHEET- 1.2
Source Code:
OUTPUT:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Source Code:
OUTPUT:
Source Code:
a=int(input("Enter the Salary :"))
if a<=20000:
print("PA")
elif a>20000 and a<=50000:
print("Staff")
elif a>50000 and a<=100000:
print("Clerk")
elif a>100000:
print("Manager")
else:
print("Default value entered")
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
OUTPUT:
Source Code:
OUTPUT:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Source Code:
OUTPUT:
OUTPUT:
print(i)
OUTPUT:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Source Code:
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:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Source Code:
OUTPUT:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING
Source Code: