Professional Documents
Culture Documents
Last But Not The Least I Wish To Avail Myself For This
Opportunity.
Thanking You
Harsh Sengar
XII-A
Index
CBSE Project File 1
6
Input:
def bubbleSort(arr):
CBSE Project File 1
6
n = len(arr)
for i in range(n):
Output:
Input:
1].""" start = 0
end = len(alist)
end = mid
'))
index < 0:
Output:
CBSE Project File 1
6
Input:
f=open("rd.txt",'w') f.write("Hello\n")
f.close()
f=open("rd.txt")
print(f.read()) f.close()
Output:
CBSE Project File 1
6
Input:
import datetime
t_date=datetime.datetime.now()
print("Today is:",t_date)
Output:
Input:
CBSE Project File 1
6
a=[70,49,31,6,65,81,68]
i in a:
j=a.index(i)
while j>0:
if a[j-1]>a[j]:
a[j-1],a[j]=a[j],a[j-1]
Output:
6.Calculator Program
Input:
def add(x, y):
return x + y def
subtract(x, y):
print("3.Multiply") print("4.Divide")
choice = input("Enter choice(1/2/3/4):
")
num1 = float(input("Enter first
number: ")) num2 =
float(input("Enter second
number: ")) if choice == '1':
print(num1,"+",num2,"=",
add(num1,num2)) elif choice ==
'2': print(num1,"-",num2,"=",
subtract(num1,num2)) elif choice
== '3': print(num1,"*",num2,"=",
multiply(num1,num2)) elif choice
CBSE Project File 1
6
== '4': print(num1,"/",num2,"=",
divide(num1,num2))
else:
print("Invalid input")
Output:
Input:
CBSE Project File 1
6
count=0
tup=() if
nterms<=0:
print("Fibonacci sequence up
print("Fibonacci sequence up
to",nterms,":")
while count<nterms:
tup=tup+(n1,)
nth=n1+n2
n1=n2 n2=nth
count+=1
print(tup)
Output:
CBSE Project File 1
6
Input: f=open("rd.txt")
print(f.readline())
print(f.readline())
print(f.readline())
print(f.readline())
Output:
CBSE Project File 1
6