Python Program Factory

1. Write Python program to find sum of two numbers. a=int(input(" Enter first number : ")) b=int(input(" Enter second number : ")) s=a+b print(" Sum of two numbers is ",s)
2. Write Python program to find average of two numbers. a=int(input(" Enter first number :")) b=int(input(" Enter second number : ")) s=(a+b)/2 print(" Average of two numbers is",s)
3. Write Python program to find simple interest. p=float(input(" Enter principal :")) t=float(input(" Enter time :")) r=float(input(" Enter rate :")) si=(p*t*r)/100 print(" Simple Interst is",si)
4. Python program to display the greater number among two numbers. a=int(input("Enter first number: ")) b=int(input("Enter second number: ")) if a>b: print(a,"is greater") else: print(b,"is greater")
5. Python program to display the smaller number among two numbers. a=int(input("Enter first number: ")) b=int(input("Enter second number: ")) if a<b: print(a,"is smaller") else: print(b,"is smaller")
6. Python program to display the greatest number among three numbers. a=int(input("Enter first number: ")) b=int(input("Enter second number: ")) c=int(input("Enter third number: ")) if a>b and a>c: print(a,"is greatest") elif b>a and b>c: print(b,"is greatest") else: print(c,"is greatest")
7. Python program to display the smallest number among three numbers. a=int(input("Enter first number: ")) b=int(input("Enter second number: ")) c=int(input("Enter third number: ")) if a<b and a<c: print(a,"is smallest") elif b<a and b<c: print(b,"is smallest") else: print(c,"is smallest")
8. Python program to check whether the given number is even or odd n=int(input("Enter a number:")) if n%2==0: print("Even") else: print("Odd")
9. Python program to print 1,2,3,......10. for i in range(1,11): print(i)