Computer Project Class 11 Cbse
Computer Project Class 11 Cbse
NAME=SOURYYA CHAKRABORTY
CLASS=11
SEC=SCI-1
ROLL=31
OUTPUT=
test_list = [10, 8, 4, 3, 1]
flag = 0
i = 1
while i < len(test_list):
if(test_list[i] > test_list[i - 1]):
flag = 1
i += 1
# printing result
if (not flag) :
print ("Yes, List is reverse sorted.")
else :
print ("No, List is not reverse sorted.")
output=
3.BUBBLE SORT
my_list = [64, 34, 25, 12, 22, 11, 90]
n = len(my_list)
4.BINARY SEARCH
# Binary search without a function and with user input
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
OUPUT=
5.SELECTION SORT
# Selection sort without a function
my_list = [64, 34, 25, 12, 22, 11, 90]
n = len(my_list)
OUTPUT=
6.RIGHT SHIFT
# Tuple program with right shift
original_tuple = (1, 2, 3, 4, 5)
shift_distance = 2
# Perform right shift
shifted_tuple = original_tuple[-shift_distance:] + original_tuple[:-
shift_distance]
OUTPUT=
7.SIZE OF A TUPLE
import sys
# sample Tuples
Tuple1 = ("A", 1, "B", 2, "C", 3)
Tuple2 = ("Geek1", "Raju", "Geek2", "Nikhil", "Geek3", "Deepanshu")
Tuple3 = ((1, "Lion"), ( 2, "Tiger"), (3, "Fox"), (4, "Wolf"))
OUTPUT=
# initializing list
test_list = [5, 6, 7]
# initializing tuple
test_tup = (9, 10)
# Adding Tuple to List and vice - versa
# Using += operator (list + tuple)
test_list += test_tup
# printing result
print("The container after addition : " + str(test_list))
OUTPUT=
# creating a list
list1 = [1, 2, 5, 6]
OUPUT=
# initializing tup
test_tup = ([7, 8], [9, 1], [10, 7])
# printing result
print("The summation of tuple elements are : " + str(res))
OUTPUT=
myKeys = list(myDict.keys())
myKeys.sort()
sorted_dict = {i: myDict[i] for i in myKeys}
print(sorted_dict)
OUTPUT=
OUTPUT=
13.SIZE OF DICTIONARY
import sys
# sample Dictionaries
dic1 = {"A": 1, "B": 2, "C": 3}
dic2 = {"Geek1": "Raju", "Geek2": "Nikhil", "Geek3": "Deepanshu"}
dic3 = {1: "Lion", 2: "Tiger", 3: "Fox", 4: "Wolf"}
OUTPUT=
# initializing dictionary
test_dict = {"Gfg": [5, 7, 5, 4, 5],
"is": [6, 7, 4, 3, 3],
"Best": [9, 9, 6, 5, 5]}
max_val = 0
max_key = None
# Printing result
print("Key with maximum unique values : " + str(max_key))
OUTPUT=
OUTPUT=