11th Class Practical Python Uui Ne W 245
11th Class Practical Python Uui Ne W 245
11th Class Practical Python Uui Ne W 245
Output:
Hello World
Experiment 2
Write a Python Program to print the value of a Variable on Screen.
a = 10
print (“Value of a is = “, a)
Output:
Value of a is = 10
Experiment 3
Write a Python Program to find the Sum of two numbers.
n1 = 5
n2 = 10
sum = a + b
print (“Sum is = “, sum)
Output:
Sum is = 15
Experiment 4
Write a Python Program to find the Sum of two numbers (entered by User).
Input:
Enter First Number = 15
Enter Second Number = 20
Output:
Sum is = 35
Experiment 5
Write a Python Program to find the Power of a number to other number (Exponentiation).
Input 1:
Enter the value of Base = 10
Enter the value of Power = 3
Output 1:
Base raise to the Power is = 1000
Input 2:
Enter the value of Base = 15
Enter the value of Power = 4
Output 2:
Base raise to the Power is = 50625
Experiment 6
Write a Python Program to convert temperature from Celsius int o Fahrenheit.
Input 1:
Enter the Temperature in Celsius = 95
Output 1:
Equivalent Temperature in Fahrenheit will be = 203.0
Input 2:
Enter the Temperature in Celsius = 37.1
Output 2:
Equivalent Temperature in Fahrenheit will be = 98.78
Experiment 7
Write a Python Program to swap Two numbers entered by the user.
Input:
Enter First Number = 5
Enter Second Number = 10
Output:
After Swapping First Number = 10
After Swapping Second Number = 5
Experiment 8
Write a Python Program to calculate the Simple Int erest and Amount for a given Principal, Rate
and Time.
Input:
Enter the Principal = 2570
Enter the Rate of Int erest per annum = 3.75
Enter the Time in Years = 4
Output:
The Simple Int erest to be paid = 385.5
The Total Amount to be paid = 2955.5
Experiment 9
Write a Python Program to calculate the Area and Perimeter of a Rectangle.
Input:
Enter the Length of Rectangle = 15
Enter the Breadth of Rectangle = 12
Output:
The Area of Rectangle is = 180
The Perimeter of Rectangle is = 54
Experiment 10
Write a Python Program to calculate the Area and Circumference of a Circle.
Input:
Enter the Radius of Circle = 8.7
Output:
The Area of Circle is = 237.81
The Perimeter of Circle is = 54.67
Experiment 11
Write a Python Program to Check whether the entered Number is Even or Odd?
Input 1:
Enter the Number = 5
Output 1:
Odd Number
Input 2:
Enter the Number = 60
Output 2:
Even Number
Experiment 12
Write a Python Program to Check whether the entered Number is ending with 2 Zeros or not?
Input 1:
Enter the Number = 75089
Output 1:
Number is NOT ending with 2 Zeros
Input 2:
Enter the Number = 68700
Output 2:
Number is ending with 2 Zeros
Experiment 13
Write a Python Program to check Greater among Two Numbers entered by user?
Input 1:
Enter the First Number = 15
Enter the Second Number = 20
Output 1:
Second Number is Greater
Input 2:
Enter the First Number = 35
Enter the Second Number = 30
Output 2:
First Number is Greater
Experiment 14
Write a Python Program to Check if for given three angles, Triangle is possible or not.
A1 = int (input ((“Enter the First Angle = ” ))
A2 = int (input ((“Enter the Second Angle = ” ))
A3 = int (input ((“Enter the Third Angle = ” ))
Total = A1 + A2 + A3
if Total == 180:
print (“The given angles will form a Triangle.”)
else:
print (“The given angles will not form a Triangle.”)
Input 1:
Enter the First Angle = 47
Enter the Second Angle = 33
Enter the Third Angle = 100
Output 1:
The given angles will form a Triangle.
Input 2:
Enter the First Angle = 41
Enter the Second Angle = 93
Enter the Third Angle = 23
Output 2:
The given angles will not form a Triangle.
Experiment 15
Write a Python Program to check Greatest among Three Numbers entered by user?
Input 1:
Enter the First Number = 15
Enter the Second Number = 20
Enter the Third Number = 19
Output 1:
Second Number is Greatest
Input 2:
Enter the First Number = 35
Enter the Second Number = 2
Enter the Third Number = 37
Output 2:
Third Number is Greatest
Experiment 16
Write a Python Program to check a year entered by user is Leap year or not?
Input 1:
Enter the Year = 2200
Output 1:
Not a Leap Year
Input 2:
Enter the Year = 1936
Output 2:
Leap Year
Experiment 17
Write a Python Program to check for given three sides of a triangle, is it equilateral, isosceles or
scalene triangle?
Input 1:
Enter the First Side = 25
Enter the Second Side = 15
Enter the Third Side = 10
Output 1:
It is a scalene (Visham bahu) Triangle
Input 2:
Enter the First Side = 25
Enter the Second Side = 15
Enter the Third Side = 25
Output 2:
It is an Isosceles (Samdwi bahu) Triangle
Input 2:
Enter the First Side = 25
Enter the Second Side = 25
Enter the Third Side = 25
Output 2:
It is an Equilateral (Sam bahu) Triangle
Experiment 18
Write a Python Program to print First 100 Natural numbers.
i=1
print (“First 100 Natural Numbers are:”)
while i <= 1000:
print (i)
i=i+1
Output:
First 100 Natural Numbers are:
1
2
3
4
…….
…..
98
99
100
Experiment 19
Write a Python Program to print table of any number N entered by user.
N = int (input ("Vo number batao, jiska Pahada Likhna hai? = "))
print ("Table of entered number is")
i=1
while i <= 10:
print (N, " x ", i, " = ", N*i)
i=i+1
Input:
Vo number batao, jiska Pahada Likhna hai? = 7
Output:
Table of entered number is
7x1=7
7 x 2 = 14
7 x 3 = 21
7 x 4 = 28
7 x 5 = 35
7 x 6 = 42
7 x 7 = 49
7 x 8 = 56
7 x 9 = 63
7 x 10 = 70
Experiment 20
Write a Python Program to find sum of First N Natural Numbers entered by user.
Input 1:
Enter the Value of N = 10
Output 2:
Sum of First N Natural Number is = 550
Input 2:
Enter the Value of N = 90
Output 2:
Sum of First N Natural Number is = 4095
Experiment 21
Write a Python Program to demonstrate Strings in python and its functions.
Input:
Enter the String = Python
Output:
Entered string is = Python
Length of Entered string is = 6
Entered string in Uppercase = PYTHON
Entered string in Lowercase = python
Operations and Slicing in Strings
First Character of string is = P
Third Character of string is = t
Fifth Character of string is = o
Substring (2nd to 3rd characters) of string is = yt
Substring (3rd to 5th characters) of string is = tho
Substring (First 4 characters) of string is = Pyth
Substring (2nd character and after that) of string is = thon
Experiment 22
Write a Python Program to demonstrate Lists in python and its functions.
Output:
First List is = [8, 45, 21, 50, 100, 30]
Operations and Slicing in First List
8
100
[45, 21, 50]
[100, 30]
[30]
[8, 45, 21, 50]
[21, 50, 100, 30]
Second List is = [20, 15, 8, 60, 100, -1]
Lenth of the second List is = 6
Before Sorting second List is = [20, 15, 8, 60, 100, -1]
After Sorting second List is = [-1, 8, 15, 20, 60, 100]