0% found this document useful (0 votes)
109 views8 pages

Holiday HW

Pushpa2× pervent couples✓

Uploaded by

msharvesh54
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
109 views8 pages

Holiday HW

Pushpa2× pervent couples✓

Uploaded by

msharvesh54
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

To print the value of a variable in Python, python uses :-

(a) Print() function (b) Print statement()


(c) print statement (d) print() function

What is the value of the expression 75 // 25?


(a) 3 (b)3.0
(c) 2.5 (d) none of these

What will be the output of following python statement: - print(“foo\\bar”)


(a) foo\\bar (b) foo\bar
(c) “foo\\bar” (d) none of these

Which of the following is a valid statement in python?


(A) abc = 1,000,000 (B) a b c = 1000 2000 3000
(C) a,b,c = 1000, 2000, 3000 (D) a_b_c = 1,000,000

Which of the following is correct way to declare string variable in Python?


(A) fruit = “banana” (B) fruit = "banana’
(C) fruit = banana (D) fruit = (banana)

Which of the following is not a valid identifier name in Python?


(i) 5info (ii) false
(iii) _broke (iv) seven_7
Which of the following are valid operator in Python:
(i) */ (ii) is
(iii) +/ (iv) like
Choose correct output:
for x in range(-25,25,15):
print(x,end=" ")
(i) -25 -10 5 20 (ii) 25 10 -5 -25
(iii) -25 -10 5 25 (iv) None of these

What is the output of the following?


x=2
y=3
i=0
while i<y*2-x:
print(i, end=" ")
i=i+1
(i) 0 1 2 4 (ii) 0 1 2 3
(iii) infinite loop (iv) compilation error
Consider the following lists:
Lst1 = [10, 20, 30, 40]
Lst2 = [11, 22, 33, 44, 55]
Which of the following statements will result in an error?
(i) Lst1 = Lst2 (ii) Lst1.copy( )
(iii) Lst2.append(15 ,20 ,35) (iv) Lst2.pop( )
Select the correct code to print cppbuzz-chicago
(A) print('cppbuzz-' + 'chicago') (B) print('cppbuzz' + '-chicago')
(C) print('cppbuzz' + '-' + 'chicago') (D) All of the above
To insert 6 to the third position in list1, we use which command?
(i) list1.insert(3, 6) (ii) list1.insert(2, 6)
(ii) list1.add(3, 6) (iv) list1.append(3, 6)
What will be the result of the following code?
MetroCity = {"B" : "Bhopal", "I" : "Indore" , "S" : "Jabalpur"}
print(MetroCity[1])
(i) Indore (ii) Jabalpur
(iii) Bhopal (iv) Error
Identify the DML Command from the following in SQL
(i) Alter (ii) Delete
(iii) Create (iv) Drop
In MYSQL, which of the following command is used to add a column in any
existing table:
(i) Add (ii) Insert
(iii) Alter (iv) Column
Identify the following identifiers as valid/invalid in Python.
Total_Marks
Total$Marks
1st_class
_average
The following code is not giving desired output. We want to input value as 10 and obtain
output as 20(10+10). Identify the error in the below code and Re-write the
code underlining each correction.
number=input(“Enter Number”)
changenum=number+10 print(changenum)
What will be the output given by following python code statements ?
(i) print(17 % 5)
(ii) print(25%5 + 7 >= 9//2) (iii)print(“Hello”+”World”)
(iv)print( 6**2 > 32//2 and 5**2==25)
Write a Python Program to find the smallest of three number.

Define the following in respect of Database Management System:


a. Degree
b. Cardinality
A table Employee has 10 rows and 4 columns. Find the degree and cardinality of table
store when one row is added and 1 column is removed from the table.
OR
Define Candidate Key.
Write a Python code to accept a set of integer number and find the sum of even number
from the list.
OR
Write a python code to accept the name of a student and create a dictionary by
assigning marks secured by him/her in English, Maths and Science subjects as shown
below :
Eng : 65
Maths : 82
Science : 75
Display the name of student alongwith the total marks
Write a program to swap two number.

Write a program to find the sum of first 100 natural number

Write the following expressions using operators used in Python:


(i) a = x3+ y4 + z5 ( ii) ar= 4/3 π r 3
Evaluate the following expressions
(iii) 12*(3+4)//2+5
Write a Python Program to find largest among three input numbers using if statement
and print the correct output?
OR
Consider the following in python and answer below:
x=20
y=11.5
z = 60
a. print(float(x))
b. print("1"*2 + “2”*2 + “3”*2)
c. print((x>y) and (y>z) or (z>x))
Consider a dictionary named Friends which stores Name and roll number of your
friends as key value pairs:
Friends={“Amit”:121, “Pooja”:456, “Ankur”:112, “Sharad”:143 , “Ankita”:532}
Write python statements to perform the following operations on this dictionary:
a. Check if a friend named “Praveen” is present in the dictionary or not
b. Display the keys of Dictionary Friends
c. Retrieve the value corresponding to the key “Pooja”.
Suppose your school management has decided to conduct cricket matches between
students of class XI and XII. Students of each class are asked to join one of the four
teams: Team Titan, Team Rockers, Team Magnet and Team Hurricane. During summer
vacations, various matches will be conducted between these teams. Help your Sports
teacher to do the following: (Any 3)
(a) Create a database “Sports”
(b)Open the Database “Sports” to work on it
(c) Show all the tables inside the database “CRICKET”
OR
(a) List down the various databases.
(b)Display the structure of the table TEAM.
(c) Create a database “score”

Write MYSQL query to create the table Employee as per the following structure:
Column-Name Data-type Size Description
Ecode integer 6 Employee Code
Ename varchar 15 Employee Name
Dept Varchar 8 Employee Department
Salary Decimal 10,2 Salary
Doj Date 8 Date of Joining
OR
What is relational operator?
Based on mysql, answer the following questions
a. Define DBMS?
b. What is data Redundancy in DBMS?
c. How many Primary Keys can exists in any table?
d. If R1 is a relation with 5 rows and 6 columns after adding 1 row and 1 column, what is
the degree and cardinality of R1 ?
e. Give one advantage of using a primary key?
OR
See the following table and Write output for (i) to (iv)
Table :WORKER
ENO NAME DOJ DOB GENDE DCOD
R E
1001 Ganesh 2013-09- 1991-09-01 MALE D01
02
1002 Rudrika 2012-12- 1990-12-15 FEMALE D03
11
1003 Mithlesh 2013-02- 1987-09-04 MALE D05
03
1007 Anand 2014-01- 1984-10-19 MALE D04
17
1004 Meghna 2012-12- 1986-11-14 FEMALE D01
09
1005 Ravindra 2013-11- 1987-03-31 MALE D02
18
1006 Jyoti 2014-06- 1985-06-23 FEMALE D05
09
(i) Select ENO, Name, Gender from WORKER order by ENO desc;
(ii) Select Name from WORKER where Gender = ”MALE”;
(iii) Select Eno, Name from WORKER where Name in (‘Anand’, ‘Jyoti’, ‘Ganesh’)
(iv) select NAME from WORKER where GENDER=”FEMALE” and DOJ> ‘1986-01-01’;
(v) Select distinct(DCODE) from WORKER.
Relation: Gym
PrCode PrName UnitPrice Manufacturer

P101 Cross Trainer 25000 Avon Fitness

P102 TreadMill 32000 AGFitline

P103 MassageChair 20000 Fit Express

P104 Vibration 22000 Avon Fitness


Trainer

P105 Bike 13000 Fit Express

Answer the following question on the basis of the above table


Gym: (Any 5)

(a) Display the names of all the products with unit price less than Rs.
20000.
(b) Display details of all the products with unit price in the range 20000 to
30000.
(c) Display the names of all the products manufactured by “Fit Express”.

(d) Change the Unit Price data of all the rows by applying a 15%
discount reduction on all the products.
(e) Delete all the records from the table
(f) Display details of all products with manufacturer name starting with "A".
a. Rewrite the following code after underlying and removing syntax errors:
name = ("Enter Driver Name :" )
age = int(input("Enter Driver Age: ")
if age = > 18 :
print(name, “is eligible for driving license")
else
print(name, "is not eligible for driving license")
OR
a. Find the output of the following :
L=["Class","XI","has",["CS","IP"],"in","the","subject","computer","science"]
print(L[6:])
print(L[3][1].lower())
print("in" in L)
print(L[7][:3] + L[8][3:])
b. Write a program which accept the name and basic salary of an employee .
Calculate and display the name, gross salary and net salary of the employee
when:
da = 30 % of Basic
hra = 18 % of Basic
pf = 12.5 % of Basic
gross = basic + da + hra
net = gross - pf
OR
b. In an examination, if student secured marks more than or equal to 33, result
should be “pass” otherwise “not pass” and also the grades are awarded to
students in Class XI Commerce according to the percentage marks obtained in
the examination.
Percentage Grades
70% and above Distinction
60% or more but less 70% First Division
40% or more but less 60% Second Division
33% or more but less 40% Pass
Less than 33% Grade not awarded
Write a Python program that accepts name of students and percentage of marks as input
and display the result as pass or not pass and grades obtained according to their
percentage.
(e.g. if percentage is 65, then output should print result pass and Grade First Division
Check the table STOCK given below:-
Write SQL queries for the following:
(a) To display the records in ascending order of quantity.
(b) To display all the Products if price is ranged between 2000 to 5000.
(c) To display the Prod name and Category of the products whose name starts with “M”
OR
Insert a new record for stock with following value: {“ 9,”Socket”, “NW”, 20,1000}
Consider the following tables MOVIE . Write outputs of SQL commands for the statements
(i) to (iv) :
Table :MOVIE
MovieI MovieNam Catego ReleaseD Producti Busin
D e ry ate on ess
Cost Cost
001 Hindi_Movie Musical 2018-04- 1245 130000
23 00
002 Tamil_Movie Action 2020-05- 1120 118000
17 00
003 English_Mov Horror 2019-08- 2450 360000
ie 06 00
004 Bengali_Mov Adventu 2022-01- 7200 100000
ie re 04 0
005 Telugu_Movi Action NULL 1000 200000
e 00
006 Punjabi_Mov Comedy NULL 3050 40000
ie 0
(i) SELECT * FROM MOVIE WHERE Category = ‘Action’;
(ii) SELECT MovieName, Category FROM Movie WHERE PorductionCost <=100000 ;
(iii) SELECT * FROM Movie WHERE Category LIKE "A%" ;
OR
SELECT DISTINCT CATEGORY FROM MOVIE ;

You might also like