Roll number: 340
Problem Statement 1: Write a python code to generate Personalized Greeting.
Program:
print("Roll no: 340")
a=input("Enter you name: ")
b=int(input("Enter your roll no: "))
c=input("Enter your Branch: ")
print("Welcome",a)
print("Welcome to",c,"Branch and Your roll no is",b)
Output:
Roll number: 340
Problem Statement 2: Write a python program to calculate areas of any geometric figures like
circle, rectangle and triangle.
# Python Program to find the area of circle
Program:
print("Roll no : 340")
a = int(input("Enter radius of circle: "))
b = 3.147 * a*a
print("Area of circle is :",b,"unit")
c = int(input("Enter width of rectangle : "))
d = int(input("Enter length of rectangle : "))
e = c*d
print("Area of rectangle is : ",e,"unit")
f = int(input("Enter base of triangle : "))
g = int(input("Enter height of triangle : "))
h = 0.5*f*g
print("Area of Traingle is:",h,"unit")
Output:
Roll number: 340
Problem Statement 3: Write a Python program to calculate the gross salary of an employee. The
program should prompt the user for the basic salary (BS) and then compute the dearness
allowance (DA) as 70% of BS, the travel allowance (TA) as 30% of BS, and the house rent
allowance (HRA) as 10% of BS. Finally, it should calculate the gross salary as the sum of BS,
DA, TA, and HRA and display the result.
Program:
print("Roll no: 340")
BS = float(input("Enter basic salary:"))
DA = 0.70 * BS
TA = 0.30 * BS
HRA = 0.10 * BS
gross_salary = BS + DA + TA + HRA
print("Gross Salary is:", gross_salary)
Output:
Roll Number: 340
Problem Statement 4: Write a program to implement different types of operators in Python
Program:
print("Roll no : 340")
a=int(input("Enter first number :"))
b=int(input("Enter second number :"))
print("Arithmetic Operator")
print("Additon :",a+b)
print("Substraction :",a-b)
print("Multiplication :",a*b)
print("Relational Operator")
print("is a and b is equal",a==b)
print("is a is greater then b",a>b)
print("Logical Operator")
print(True and False)
print(True or False)
print(not True)
print("Assigment Operator")
a += 3
b -= 1
print(a)
print(b)
print("Identiy operator")
print(a is b)
print(a is not b)
Output: