#1. Find the area of the retangle. length = int (input("enter the length")) breadth= int (input("enter the breadth")) area = length*breadth print('rectangle area' ,area)
#2. Find simple interest. principal = float(input("Enter the principal amount: ")) rate = float(input("Enter the rate of interest: ")) time = float(input("Enter the time (in years): ")) simple_interest = (principal * rate * time) / 100 print("Simple Interest:", simple_interest)
#3. Convert temperature from celcius to Fahrenheit. celsius = float(input("Enter temperature in Celsius: ")) fahrenheit = (9/5 * celsius) + 32 print("Temperature in Fahrenheit =", fahrenheit)
num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) num3 = float(input("Enter third number: ")) average = (num1 + num2 + num3) / 3 print("Average =", average)
num = float(input("Enter a number: ")) square = num ** 2 cube = num ** 3 print("Square =", square) print("Cube =", cube)
a = int(input("Enter first number: ")) b = int(input("Enter second number: ")) a = a + b b = a - b a = a - b print("After swapping:") print("First number =", a) print("Second number =", b)
#variables, calculate total and percentage, use comments use proper indentation. name = input("Enter student name: ") roll_no = input("Enter roll number: ")
marks1 = float(input("Enter marks of Subject 1: ")) marks2 = float(input("Enter marks of Subject 2: ")) marks3 = float(input("Enter marks of Subject 3: "))
total = marks1 + marks2 + marks3
percentage = (total / 300) * 100
print("\n----- Student Report -----") print("Student Name :", name) print("Roll Number :", roll_no)
print("\nMarks:") print("Subject 1 :", marks1) print("Subject 2 :", marks2) print("Subject 3 :", marks3)
print("\nTotal Marks :", total) print("Percentage :", percentage, "%")