Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1.
a) Which of the following is a valid logical operator in Python: (1)
(i) + (ii) // (iii) < (iv) NOT
b) Write the type of literal from the following: (1)
(i) a = 25 (ii) a = ‘abc’
c) Name the Python Library modules which need to be imported to invoke the following functions:
(1)
(i) sqrt( ) (ii) pow ( )
d) Rewrite the following code in python after removing all syntax error(s). Underline each correction
done in the code. (2)
a=10
While (a<50)
IF a%5= = 0:
print (a*5)
Else:
print (a+4)
e) Find and write the output of the following python code: (2)
count = 0
while count<10:
print(‘Hello’)
count + = 1
f) Find and write the output of the following python code: (3)
def addEm(x,y,z):
print(x+y+z)
def prod(x,y,z)
return x*y*z
A = addEm(6, 16, 26)
B = prod(2,3,6)
print(a,b)
g) Find and write the output of the following python code: (2)
x=10
y=0
while x>y:
print(x,y)
x = x-1
y = y+1
2.
a) Name two different types of iteration statements? (1)
b) Which is the correct form of declaration of list? (1)
(i) Day={1:’a’,2:’b’,3:’c’}
(ii) Day=(1;’a’,2;’b’,3;’c’)
(iii) Day=[1, 2, 3]
(iv) Day= “abcd”
c) Identify the valid declaration of A = [11, 233, ‘hru’, 9]. (1)
(i) list (ii) dictionary (iii) array (iv) tuple
d) Find and write the output of the following python code: (1)
for P in range (1,10)
print (P)
e) Find and write the output of the following python code: (1)
def interest (p,t=2,r=0.10):
return(p*t*r)
print (interest(p=500)
f) What is the difference between a local variable and a global variable? Also, give a suitable Python
code to illustrate both. (2)
g) Given an ndarrays p as ([1, 2, 3, 4]). Write code to plot a bar chart having bars for p and p**2 (with
red color) and another bar for p vs p*2(with blue color). (2)
OR
Draw the chart for the following code:
Plt.plot(x,y, ‘r-‘)
Plt.xlabel(‘x’)
Plt.ylabel(‘y’)
Plt.title(‘My Chart’)
h) Write a program to read complete file-in a list. (2)
OR
Read the code given below and answer the question:
Fh=open(“main.txt”, “w”)
Fh.write(“Byes”)
Fh.close( )
If the file contains “GOOD” before execution, what will be the contents of the file after execution of
this code?
i) Write a recursive function to find the product and sum of any two given numbers. (2)
j) Define Big ‘O’ notation. State the two factors which determine the complexity of an algorithm. (2)
k) Write a program to show the use of recursion in calculation of power e.g. ab. (3)
SECTION : B
3.
a) What is a network? (1)
b) What is a HUB? (1)
c) What are major types of networks? (1)
d) What is the purpose of using router? (1)
e) Give the full forms of the following: (2)
(i) WAP
(ii) NIC
(iii) RFID
(iv) IoT
f) What is carrier wave? What is modulated wave? (2)
g) The wireless networks employ strategies to avoid collisions. Why can’t they detect collisions? (3)
h) Which two statements are correct about IPv4 and IPv6 addresses?(choose two) (2)
SECTION : C
4.
a) Which key word is used to eliminates duplicate rows from the results of a SELECT statement? (1)
b) Which constraint is used to uniquely identify each row in a table? (1)
c) Write two examples of DBMS software. (1)
d) What is meant by NULL value in MySQL? (1)
e) What is the use of UPDATE statement in SQL? How is it different from ALTER statement? (2)
f) What is Django? (2)
g) Write a output for SQL queries (i) to (iii), which are based on the table: Employ given below: (3)
Table : Employ