Write a python program to find maximum between three numbers.

Write a python program to find maximum between three numbers. SOLUTION…. # Program to find maximum among three numbers using if-else # Input a = float(input(“Enter first number: “)) b = float(input(“Enter second number: “)) c = float(input(“Enter third number: “)) # Logic using if-else if a >= b and a >= c: print(“A is […]

Write a Python program to calculate area of an equilateral triangle.

Write a Python program to calculate area of an equilateral triangle. SOLUTION…. # Program to calculate area of an equilateral triangle import math # for square root function # Input side = float(input(“Enter the side of the equilateral triangle: “)) # Formula: (√3 / 4) × side² area = (math.sqrt(3) / 4) * (side ** […]

Write a Python program to enter two angles of a triangle and find the third angle.

Write a Python program to enter two angles of a triangle and find the third angle. SOLUTION…. # Program to find third angle of a triangle # Input angle1 = float(input(“Enter first angle of triangle: “)) angle2 = float(input(“Enter second angle of triangle: “)) # Formula: Sum of angles of a triangle = 180 angle3 […]

Write a Python program to enter two numbers and perform all arithmetic operations.

Write a Python program to enter two numbers and perform all arithmetic operations. SOLUTION…. # Program to perform all arithmetic operations on two numbers # Input a = float(input(“Enter first number: “)) b = float(input(“Enter second number: “)) # Arithmetic operations stored in different variables addition = a + b subtraction = a – b […]

Write a Python program to enter P, T, R and calculate Simple Interest.

Write a Python program to enter P, T, R and calculate Simple Interest. SOLUTION…. # Input values P = float(input(“Enter Principal amount (P): “)) T = float(input(“Enter Time (T in years): “)) R = float(input(“Enter Rate of Interest (R): “)) # Formula for Simple Interest SI = (P * T * R) / 100 # […]

Write a Python program to enter temperature in Celsius and convert it into Fahrenheit and Vice Versa.

Write a Python program to enter temperature in Celsius and convert it into Fahrenheit and Vice Versa. SOLUTION…. # Fahrenheit to Celsius fahrenheit = float(input(“Enter temperature in Fahrenheit: “)) celsius = (fahrenheit – 32) * 5/9 print(f”{fahrenheit}°F = {celsius:.2f}°C”) # Celsius to Fahrenheit celsius = float(input(“nEnter temperature in Celsius: “)) fahrenheit = (celsius * 9/5) […]