Python Programs
Python Programs
PROGRAMS
1 print("The cat drove the car, ") The cat drove the car.
2 print("The puppy makes great pizzas.") The puppy makes great pizzas.
3
4
1 print("2+5") 2+5
2 print(2+5) 7
1 a-10 a+b= 14
2 b=4
3 print ("a+b=" ,a+b)
2 b=5
3 print("Area=", 1*b)
4
5
Note: The values are added, once int) and float(0 are used.
1 no1=int (input ("Enter the first number=") ) Enter the first number=10
2 no2=int(input (" Enter the second number=")) Enter the second number=5
3 print ("The first umber which you entered is" The first number which you entered is 10
, no1) The second number which you entered is 5
4 print ("The second number which you entered
is",no2)
1 a=int (input (" Enter first number -")) Enter first number-15
2 b=int (input("Enter second number-")) Enter second number-5
sum=a-b The sum is 20
4 difference-a-b The difference is 10
5 product=a*b The product is 75
6 quotient=a/b The quotient is 3.0
7 print (" The sum is", sum)
8 print (" The difference is",difference)
9 print ("The product is" , product)
10 print(" The quotient is",quotient)
4 print("Area=",area)
Program 13: Write a program to input length and
breadth. Calculate the Perimeter of rectangle
main.py Run Shell