r = float(input("Enter the rate of interest : ")) t = float(input("Enter the time in the years: ")) si = (p*r*t)/100 print("Principle amount: ", p) print("Interest rate : ", r) print("Time in years : ", t) print("Simple Interest : ", si) 2. Python program to return maximum of two numbers
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: ")) if(num1 > num2): print(num1, "is greater") elif(num1 < num2): print(num2, "is greater") else: print("Both are equal") 3. Python program to find the area and perimeter of a circle in python pi=3.14 r = float(input("Enter radius of the circle: ")) area = (pi*r*r) perimeter = (2*pi*r) print("The area of circle is ", "%.2f" %area) print("The perimeter of circle is", "%.2f" %perimeter)
4. Python program to check leap year by using the calendar module
import calendar year=int(input('Enter the value of year: ')) leap_year=calendar.isleap(year) if leap_year: # to check condition print('The given year is a leap year.') else: print('The given year is a non-leap year.') 5. Program for largest of three numbers in Python a = int(input("Enter A: ")) b = int(input("Enter B: ")) c = int(input("Enter C: ")) if a > b: if a > c: g=a else: g=c else: if b > c: g=b else: g=c print("Greater = ", g)
6. Percentage Discount Calculator Implementation , The discount rates are: