Write a Python program to check whether a number is palindrome or not.

Write a Python program to check whether a number is palindrome or not. SOLUTION…. n = int(input(“Enter the number :- “)) temp = n rev = 0 while temp > 0: rem = temp % 10 rev = (rev * 10)+rem temp = temp //10 if rev == n: print(“The number is Palindrome”) else: print […]

Write a Python program to calculate profit or loss.

Write a Python program to calculate profit or loss. SOLUTION…. # Program to calculate Profit or Loss # Input cp = float(input(“Enter Cost Price: “)) sp = float(input(“Enter Selling Price: “)) # Check Profit or Loss if sp > cp: profit = sp – cp print(“Profit = “,profit) elif cp > sp: loss = cp […]

Write a Python program to input week number and print week day

Write a Python program to input week number and print week day SOLUTION…. # Program to print weekday from week number # Input week_num = int(input(“Enter week number (1-7): “)) # Check and print weekday if week_num == 1: print(“Monday”) elif week_num == 2: print(“Tuesday”) elif week_num == 3: print(“Wednesday”) elif week_num == 4: print(“Thursday”) […]

Write a python program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following:

Write a python program to input marks of five subjects Physics, Chemistry, Biology, Mathematics and Computer. Calculate percentage and grade according to following: SOLUTION…. # Program to calculate percentage and grade of 5 subjects # Input marks physics = float(input(“Enter marks in Physics: “)) chemistry = float(input(“Enter marks in Chemistry: “)) biology = float(input(“Enter marks […]