Class - XII Half Yearly computer Science Important Question
1 |
Which of the following is a valid variable name in
Python? |
2 |
What will be the output of the following code: |
3 |
Which of the following is used to handle exceptions in
Python? |
4 |
What is the default mode of the |
5 |
Which keyword is used to define a function in Python? |
6 |
What is the output of the following code? |
|
|
|
print |
|
a) 1 b) 2 c) 3 d) -1 |
7 |
Which of the following is not a data
type in Python? |
8 |
What is the result of: |
9 |
Which of the following can be used to connect to a
MySQL database in Python? |
10 |
Which command is used to create a table in SQL? |
11 |
What is the purpose of the |
12 |
Which of the following is an aggregate function in SQL? |
13 |
What is the output of |
14 |
What will be the output? |
|
print |
|
a) list
b) dict |
15 |
In Python, which statement is used to exit a loop
prematurely? |
16 |
The SQL clause |
17 |
In Python, how do you open a file for writing in binary
mode? |
18 |
Which method is used to remove an item from a list in
Python by index? |
19 |
Which command is used to delete all records from a
table in SQL without deleting the table? |
20 |
Which of the following is a valid Python set
declaration? |
21 |
What is the output of the following: |
|
print("abc".upper()) |
|
a) abc
b) ABC |
|
|
22 |
Differentiate between |
23 |
Write any two differences between tuple
and list. What is the difference
between ‘/’ and ‘//’ ? |
24 |
What is exception handling? Explain with one example in
Python. |
25 |
Write the output: a = "CBSE Computer" print(a[5:13]) |
26 |
Write any two uses of MySQL in
Database Management. |
27 |
What will be the output of the following code? def add(x, y=5):
return x +
y print(add(3)) |
28 |
What is the purpose of using |
|
|
29 |
Write a Python program to read a file named |
30 |
Write an SQL
query for the following table: |
|
Table: STUDENT |
|
| ID | Name | Marks | | 1 | Aman | 78
| | 2 | Rita | 91
| | 3 | John | 64
| a) Display names of students scoring more than 70 |
31 |
Write a Python function that accepts a list and returns
a dictionary with elements as keys and their frequency as values. OR How many times will Python execute the code inside the following while
loop? You should answer the question without using the interpreter! Justify
your answers. i = 0 while i < 0 and i > 2 : print “Hello ...” i = i+1 |
|
|
32 |
Write a Python program to create a binary file
|
33 |
Consider the following table TEACHER: | TID | Name |
Subject | Salary | | 1 |
Mohan | CS | 75000
| | 2 | Anjali |
Maths | 70000 | | 3 | Ravi | Physics | 80000 | Write SQL queries for: |
34 |
Write a Python class |
35 |
Write Python
code to demonstrate file handling:
Differentiate between the round() and floor() functions with the help of suitable example. |
|
|
36 |
Write a menu-driven program in Python to do the
following: |
37 |
A company stores data of its employees in a text file.
Each line has data in format: |
38 |
Write a program to convert binary to
decimal |