Practical File Amit (2)
Practical File Amit (2)
9. WAP to input day number and print corresponding day name for
if input.
15. WAP to print the highest and lowest values in the dictionary.
16. WAP to calculate profit or loss for a given cost and selling price.
23. WAP to print 6 times english classes then print 1 times computer
classes.
29. WAP to input the total number of sections and stream name in
11th class and display all information on the output screen.
PROGRAM - 1
# WAP to calculate the sum of three numbers using the input function.
OUTPUT
[Program finished]
PROGRAM - 2
# WAP to calculate the average of three numbers using the input function.
OUTPUT
[Program finished]
PROGRAM - 3
OUTPUT
[Program finished]
PROGRAM - 4
# WAP to calculate the area of a rectangle.
length=int(input("enter the length="))
breath=int(input("enter the breath="))
area=length*breath
print("area of rectangle=",area)
OUTPUT
[Program finished]
PROGRAM - 5
OUTPUT
[Program finished]
PROGRAM - 6
OUTPUT
enter temperature of water90
liquid state
[Program finished]
PROGRAM - 7
# WAP to input 3 Side of triangle and print the type of triangle - equilateral,scalene, isosceles.
OUTPUT
enter side 1 80
enter side 2 50
enter side 3 20
scalene
[Program finished]
PROGRAM - 8
OUTPUT
[Program finished]
PROGRAM - 9
# WAP to input day number and print corresponding day name for if input.
OUTPUT
[Program finished]
PROGRAM - 10
[Program finished]
PROGRAM - 11
OUTPUT
[Program finished]
PROGRAM - 12
OUTPUT
[Program finished]
PROGRAM - 13
# WAP to find the maximum, minimum mean of numeric value stored in a list.
list1=[12,18,34,9,21]
max=list1[0]
min=list1[0]
n=len(list1)
sum=0
OUTPUT
[Program finished]
PROGRAM - 14
[Program finished]
PROGRAM - 15
OUTPUT
[Program finished]
PROGRAM - 16
# WAP to calculate profit or loss for a given cost and selling price.
OUTPUT
[Program finished]
PROGRAM - 17
if(ch.isupper()):
print("The Given Character ", ch, "is an Uppercase")
elif(ch.islower()):
print("The Given Character ", ch, "is a Lowercase")
else :
print("The Given Character ", ch, "is Not a Lower or Uppercase")
OUTPUT
[Program finished]
PROGRAM - 18
OUTPUT
[Program finished]
PROGRAM - 19
else :
print("enter the positive number") ;
OUTPUT
[Program finished]
PROGRAM - 20
# WAP to enter the monthly sales of the salesman and give him commission if the monthly sale
is more than 500000 then commission will be 10% of monthly sale otherwise 5%.
commission = 0.05
if sales > 500000 :
commission = 0.1
print("you earned:$+str(sales*commission")
OUTPUT
[Program finished]
PROGRAM - 21
# WAP to sort three numbers entered by a user.
OUTPUT
[Program finished]
PROGRAM - 22
OUTPUT
[Program finished]
PROGRAM - 23
# WAP to print 6 times account classes then print 1 times gabs classes.
num=5
for i in range (1,6):
print("account classes")
print("gabs classes")
OUTPUT
account classes
account classes
account classes
account classes
account classes
gabs classes
[Program finished]
PROGRAM - 24
a="python"
for i in a:
print("character=",i)
OUTPUT
character= p
character= y
character= t
character= h
character= o
character= n
[Program finished]
PROGRAM - 25
OUTPUT
*
**
***
****
*****
******
[Program finished]
PROGRAM - 26
fruits=['apple','orange','banana','mango']
fruits.append("cherry")
print(fruits)
OUTPUT
[Program finished]
PROGRAM - 27
OUTPUT
[Program finished]
PROGRAM - 28
# WAP to enter names of employees and their salaries as input and store them in a dictionary
using a for loop.
OUTPUT
employee_name salary
aryan 75000
shiva 80000
ankit 90000
[Program finished]
PROGRAM - 29
# WAP to input the total number of sections and stream name in 11th class and display all
information on the output screen.
class xi=dict( )
n=int(input("enter total number of sections in xi class :"))
i=1
while i<=n :
a=input("enter section:")
b=input("enter stream name:")
class xi [a]=b
i=i+1
print("class",'\t',"section",'\t',"stream name")
for i in class xi :
print("xi",'\t',i,'\t',class xi [i])
OUTPUT
[Program finished]
PROGRAM - 30
My_list = [1, 2, 3, 4, 2, 2, 3, 1, 5]
element_to_count = 2
frequency = count_frequency(my_list, element_to_count)
print(f"The frequency of {element_to_count} is: {frequency}")
OUTPUT
[Program finished]
S.no Practical list Teacher signature
11. Write a SQL query to add the email id's of each student in
the previously created email column.
Query - 1
Write a SQL query to create a database.
Query - 2
Write a SQL query to create a student table with the student I'd, class,
section,gender,name,dob, and marks as attributes where the student I'd is the primary
key.
Query - 4
Write a SQL query to delete the details of a particular student in the student
table.
DELETE
FROM student
WHERE name = 'Amit Singh' ;
Query - 5
Write a SQL query to increase the marks by 5% for those students who are
scoring Marks more than 30.
UPDATE student
SET marks = marks * 1.05
WHERE marks > 30;
Query - 6
Write a SQL query to display the entire content of the table.
SELECT *
FROM student;
Query - 7
Write a SQL query to display student_id,name and marks of those students
who are scoring Marks more than 30.
Query - 8
Write a SQL query to find the average marks from the student table.
Query - 9
Write a SQL query to find the number of students, who are from section 'A'.
SELECT COUNT(*)
FROM student
WHERE section = 'A';
Query - 10
Write a SQL query to add a new column email in the student table with
appropriate data type.
UPDATE student
SET email = CASE
WHEN student_id = 1 THEN '[email protected]'
WHEN student_id = 2 THEN '[email protected]'
WHEN student_id = 3 THEN '[email protected]'
WHEN student_id = 4 THEN '[email protected]'
WHEN student_id = 5 THEN '[email protected]'
WHEN student_id = 6 THEN '[email protected]'
WHEN student_id = 7 THEN '[email protected]'
WHEN student_id = 8 THEN '[email protected]'
WHEN student_id = 9 THEN '[email protected]'
WHEN student_id = 10 THEN '[email protected]'
ELSE email
END;
Query - 12
Write a SQL query to display the information of all the students, whose
name starts with 'S'.
SELECT *
FROM student
WHERE name LIKE 'S%';
Query - 13
Write a SQL query to display the student_id,name,dob of those students
who are born between ‘2005-01-01’ and ‘2005-12-31’.
Query - 15
Write a SQL query to display the student_id,gender,name,dob,marks, email
of student in descending order of their marks.
Query - 16
Write a SQL query to display the unique section name from the student
table.
Query - 17
Shiva,a student of class Xll, created a table "class". Grade is one of the
columns of this table.
Write a SQL query to find the details of students whose grade have not
been entered.
SELECT *
FROM class
WHERE grade IS NULL;
Query - 18
Shiva is using a table with the following details:
Students(Name, Class, Stream_id, Stream_Name)
Write the SQL query to display the names of students who have not been
assigned any stream or have been assigned Stream_Name that end with
“computers”.
SELECT Name
FROM Students
WHERE Stream_Name IS NULL OR Stream_Name LIKE '%computers';