You are on page 1of 3

.

Section A 5x1=5

1. The following code is not giving desired output. We want to input value as 20 and obtain
output as 40.Could you pinpoint the problem?
Number=input(“Enter Number”)
DoubleTheNumber=Number*2
Print(DoubleTheNumber)
2. What will be the output of the following code snippet?
values=[]
for i in range(1,4):
values.append(i)
print(values)
3. Trace the flow of execution for following programs:
1.def increment(x);
2. x=x+1
3.
4.#main program
5.x=3
6.print(x)
7.increment(x)
8.print(x)
4. What is docstrings?How are they useful?
5. Write a single loop to display all the contents of a text file e:\poem.txt after removing leading
and trailing whitespaces.

Section B 15x2=30

1. Why is following code printing 1 endlessly?


def Out_upto(n):
i=1
if i>n:
return
else:
print(i)
i+=1
Out_upto(i)
Out_upto(4)
2. What is the worst case complexity of the following code fragment?
for i in range(n):
a=i+(i+1)
print(a)
for j in range(m):
b=i*(i+1)
print(b)
3. Name some commonly used chart types.
4. What is the difference between a regular 2D list and a ragged list?
5. What will be the output produced by the following code?
text=[‘h’,’e’,’l’,’l’,’o’]
print(text)
vowels=”aeiou”
newText=[x.upper() for x in text if x not in vowels]
print(newText)
6. What is a Data Structure?
7. Write the equivalent infix expression for: 10, 3, *, 7, 1, -, *, 23, +
8. What is demodulation? How is it different from modulation?
9. What is routing table? What type of information is stored in a routing table?
10. What is NIC?
11. What are the different types of SQL functions?
12. Write a query to display the number of employees with same job.
13. What is Django?
14. What is a result set?
15. What are intellectual property rights?

Section C 5x3=15

1. What is a statement? What is the role of comments and indentation in a program?


2. State one advantage and one disadvantage of using recursion over iteration?
3. In general, What common operations are performed on different Data Structures?
4. Gopi Krishna is using a table Employee. It has the following columns:
Code, Name, Salary, Deptcode
He wants to display maximum salary department wise. He wrote the following command:
SELECT Deptcode,Max(Salary) FROM Employee;
But he did not get the desired result. Rewrite the above query with necessary changes to help
him get the desired output.
5. What is digital property? Give some examples of digital properties.

Section D 5x4=20

1. Evaluate the following postfix notation of expression: 50, 60, +, 20, 10, -, *
2. Consider the following table named “SOFTDRINK”. Write commands of SQL for (i) to (iv)
Table: SOFTDRINK
DRINKCODE DNAME PRICE CALORIES
101 Lime and Lemon 20.00 120
102 Apple Drink 18.00 120
103 Nature Nectar 15.00 115
104 Green Mango 15.00 140
105 Aam Panna 20.00 135
106 Mango Juice Bahaar 12.00 150

(i) To display names and drink codes of those drinks that have more than 120 calories.
(ii) To display drink codes, names and calories of all drinks, in descending order of
calories.
(iii) To display names and price of drinks that have price in the range 12 to 18 (both 12
and 18 included)
(iv) Increase the price of all drinks in the given table by 10%.
3. You have created a Django project namely EasySell. It contains three apps in it:
(i) Register (ii) Sell (iii) Work folder.
What will be the contents of Django project folder. Only list the folders, do not list any file
inside app folders.
4. Mr.Jayanto Das is confused between Shareware and Open source software. Mention at least
two points of differences to help him understand the same.
5. Write a program that asks the user to input number of seconds and then expresses it in terms
of many minutes and seconds it contains.

You might also like