Class 11 CBSE - Python Fundamentals Programs

Python is designed to understand the user’s responsibility, the protocol, and the ethical issues related to the field of computing.
Python in class 11 for cbse is very handy when it comes to practice on computers but for the beginers there might be some errors and problems such as exception. But it's always advisable to practice program on computer than writing it on paper because it cherishes your practical skills , knowledge and typing speed and you'll come to know new things and if you want to be a software developer someday then its a must call for you.
Program 1: Write a Python program to input 2 number and find the sum, difference and product of those numbers.
Solution:
a = (int(input("Enter first no.=")))
b = (int(input("Enter first no.=")))
c = a+b
d = a-b
e = a*b
print("Sum of Numbers =", c,'\n',"Difference of Numbers =", d,'\n', "Product of Numbers =", e)
                    

Program 2: Write a Python program to input a number and print the square and cube of that number.
Solution:
a = (int(input("Enter the no.=")))
sq = a*a
cube = a*a*a
print("Square of number =", sq, '\n',"Cube of number =", cube)
                        

Program 3: Write a Python program to find the area of rectangle using functions.
Solution:
def areaRectangle(length, breadth):
area = length * breadth
return area

areaRectangle(20, 30)
                     
 
                        

                        

Program 4: Write a Python program to print the square of first three natural numbers.
Solution:
def get_square(num):
return num * num

for i in [1,2,3]:
result = get_square(i)
print('Square of',i, '=',result)

 

Contact Us

REACH US

SERVICES

  • CODING
  • ON-LINE PREPARATION
  • JAVA & PYTHON

ADDRESS

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 919839520987
Email:info@alexsir.com