11th UPDATED IP Practical File 2023
11th UPDATED IP Practical File 2023
Practical File
on
Subject:Informatics Practices (065)
Class :XI
(2023-24)
Submitted by:
Name: ________________
Roll No.: ________________
CERTIFICATE
I which to express my deep gratitude and sincere thanks to Principal Dr. Chitra
Singh Bankavat, Dr. Bansi Dhar School, Kota for her encouragement and for all
the facilities provided by her for these practicals.
I sincerely appreciate this magnanimity by taking me into fold for which I shall
remain indebted to her.
I extend my hearty thanks to the subject teacher who guided me to the successful
completion of these practicals. His guidance, constant encouragement,
constructive comments, sympathetic attitude and immense motivation, has
sustained my efforts to all stages of these practicals.
sum=eng+hin+mat+sci+sst
avg = sum/5
pr = sum/500*100
print("Average: ",avg)
print("Percentage : ",pr)
if(pr>=90):
print("Grade = A")
elif(pr>=80):
print("Grade = B")
else:
print("Grade = C")
OUTPUT:
Enter marks of English: 89
Enter marks of Hindi: 87
Enter marks of Maths: 90
Enter marks of Science: 85
Enter marks of Social Studies: 91
English : 89
Hindi : 87
Maths : 90
Science : 85
Social Studies : 91
Average: 88.4
Percentage : 88.4
Grade = B
1
Q.2 Write a python program to find sale price of an item with given cost and discount (%).
Ans.
# To find sale price of an item with given cost and discount (%).#
dis=(cp*d/100)
sp=cp-dis
OUTPUT:
Enter the price of a product: 200
print("COMPOUND INTEREST")
amt=p*(pow((1 + r/100),t))
ci=amt-p
print("Compound Interest : ",ci)
OUTPUT:
Enter Principle Amount: 10000
Enter Time(in years): 5
Enter Interest Rate (%): 8
SIMPLE INTEREST:
Principle Amount: 10000
Time: 5
Interest Rate: 8
2
Simple Interest : 4000.0
COMPOUND INTEREST
Compound Interest : 4693.28
Q4. Write a python program to calculate profit-loss for given Cost and Sell Price.
Ans.
cp=int(input("Enter Cost Price: "))
sp=int(input("Enter Selling Price: "))
profit=sp-cp
print("Profit :",profit)
OUTPUT:
Enter Cost Price: 550
Enter Selling Price: 870
Profit : 320
Q5. Write a python program to find the largest and smallest numbers in a list.
Ans.
#To find the largest and smallest numbers in a list.#
l1=[30,60,8,34,74]
length=len(l1)
l1.sort()
print("length:",l1)
print("largest number : ", l1[4])
print("smallest number: ",l1[0])
OUTPUT:
length: [8, 30, 34, 60, 74]
largest number : 74
smallest number: 8
OUTPUT:
Enter a number for table: 2
2
4
6
8
10
12
14
16
18
20
3
Q7. Write a python program to count the number of vowels in user entered string.
Ans. # To count the number of vowels in user entered string.#
str=input("Enter a string: ")
count=0
for n in str:
if(n=='a'or n=='e'or n=='i'or n=='o'or n=='u'):
count=count+1
print(count)
OUTPUT:
Enter a string: education
5
Q8. Write a python program to Create a dictionary to store names of states and their capitals.
Ans.
#Create a dictionary to store names of states and their capitals.#
dict={'Rajasthan':'Jaipur','Gujarat':'Gandhi Nagar','Uttar Pradesh':'Lucknow'}
print(dict)
OUTPUT: {'Rajasthan': 'Jaipur', 'Gujarat': 'Gandhi Nagar', 'Uttar Pradesh': 'Lucknow'}
Q9. Write a python program to create a dictionary of students to store names and marks obtained
in 5 subjects.
Ans.
# Create a dictionary of students to store names and marks obtained in 5 subjects.#
result={}
for i in range(stud_no):
print("Enter the details: ",i+1)
result[rollno]=[name,subject,marks]
print(result)
OUTPUT:
Enter number of students: 3
Enter the details: 1
Enter Marks:60
4
{101: ['Avinash', 'English', 60]}
Enter the details: 2
Enter Marks:56
{101: ['Avinash', 'English', 60], 102: ['Mayank', 'Social Studies', 56]}
Enter the details: 3
Enter Marks:87
{101: ['Avinash', 'English', 60], 102: ['Mayank', 'Social Studies', 56], 103: ['Sushil Kumar',
'Computer', 87]}
Q10. Write a python program to print the highest and lowest values in the dictionary.
Ans. # To print the highest and lowest values in the dictionary.#
a={"s1":30,"s2":56,"s3":80,"s4":10}
b= a.values()
greater=max(b)
lowest=min(b)
print(b)
OUTPUT:
dict_values([30, 56, 80, 10])
greater number is : 80
lowest number is: 10
if i in l1:
print("found")
else:
print("not found")
5
OUTPUT:
Enter a number to be searched:44
Found
l1=[10,5,12,14,7,2,33]
print("List before adding an element: ")
n= int(input("Enter a number to be added:"))
l1.append(n)
print("List after adding an element: ",l1)
OUTPUT:
List before adding an element:
Q13. Write a python program to print Fibonacci series up to ‘n’ terms in python.
Ans. # Write a program to print Fibonacci series up to „n‟ terms in python.#
count=0
while count<=n:
print(x, end=" ")
s=x+y
x=y
y=s
count=count+1
OUTPUT:
0 1 1 2 3 5 8 13 21 34
6
Q14. Write python program to draw following pattern.
*
**
***
****
*****
Ans. #Write python program to draw following pattern.#
n=int(input("How many time you want to print a pattern:"))
for i in range(0,n):
for j in range(i+1):
print("*",end="")
print("\r") # ending line after each row
Q2. Create table emp_ records as per the structure given below.
Ans. Create table emp_records(empid int(3), emp_nm varchar(20), city varchar(12), dept. varchar(12),
salary int(6), hra int(6), pf int(5), net_sal int(8);
Q3. Write MYSQL query to enter the following records in table ‘emp_records’.
Ans.
Insert into emp_records values (101,‟Vishal‟,Pune‟,‟Accounts‟,25000,NULL,NULL,NULL);
7
Q.4 Write a query to arrange all records in descending order for the given table on basis of salary.
Q.5 Write a query to update the record having employee id as 106 and assign city as Kota.
Q.6 Write MYSQL query to delete records from the table where employee name is Mayank.
Q.7 Write MYSQL query to add primary key to empid in the above table.
Q.8 Write MYSQL query to rename column ‘Dept.’ to ‘Department’ in the table Emp_Records.
Q.13 Write a query to display all records for employee having city name beginning with ’D’ in
emp_records table.
Q.14 Write a query to display all records from emp_records having exactly four letters city name.