You are on page 1of 2

Lab Work - 16/10/23

Akshay Sasi
Mtech CS

1. monthlysales = float(input("Enter the monthly sales amount: "))


if monthlysales > 500000:
commission = monthlysales * 0.10
Else:
commission = monthlysales * 0.05
print("Commission = ",commission," rupees")

2. number = int(input("Enter the number: "))


if number < 0:
absolute = -number
else:
absolute = number
print("The absolute value is : “,absolute)

3. temp = float(input("Enter the water temperature in Celsius: "))


if temp <= 0:
state = "Solid state."
elif 0 < temp < 100:
state = "Liquid state."
else:
state = "Gaseous state."
print("The water is in ",state)

4. m1 = int(input("Enter marks for subject 1: "))


m2 = int(input("Enter marks for subject 2: "))
m3 = int(input("Enter marks for subject 3: "))
m4 = int(input("Enter marks for subject 4: "))
m5 = int(input("Enter marks for subject 5: "))
avg = (m1 + m2 + m3 + m4 + m5) / 5
print("The average marks for the 5 subjects is: ", avg)
5. num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
num3 = int(input("Enter the third number: "))
if num1 >= num2 and num1 >= num3:
largest = num1
elif num2 >= num1 and num2 >= num3:
largest = num2
else:
largest = num3
print("The largest number is: ",largest)

6. for num in range(1, 100):


if num % 2 != 0 and num % 3 != 0:
print(num)

You might also like