Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Computer Science Assignment -1

Maximum Marks: 40 Due Date: 02-10-2020

Q:1 Multiple Choice Question (10*1=10)

1) Which of the following is valid arithmetic operator in Python:

(i) // (ii) ? (iii) < (iv) and

2) Which of the following is not a valid identifier?

i) nonlocal (ii) false (iii) my_sql (iv) eval

3) Which of the following is not a valid arithmetic-assignment operators

(i) += (ii) == (iii) %= (iv) //=

4) Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?

(i) [3, 4, 5, 20, 5, 25, 1, 3] (ii) [1,3,3, 4, 5, 20, 5, 25]

(iii) [3, 5, 20, 5, 25, 1, 3] (iv) [1, 3, 4, 5, 20, 5, 25,]

5) What is the output of the following program :

def myfunc(a):
a=a+2
a=a*2
return a
print myfunc(2)
(i) 8 ii) 16 (iii) Indentation Error (iv) Runtime Error
6)There is a Dictionary employee={‘salary:10000’,’dept’:Sales,’age’:24,’name’:’John’}

Which of the following function will provide all the values of dictionary?

(i) employee.keys() (ii) employee.values()

(iii) employee.items() (iv) employee.clear()

7)Which of the following symbol is used to replicate two strings or two lists or two tuples?

(i)# (ii) // (iii) * (iv)+


8) What is the meaning of Top-Level Statements in Function?
i)statement which are defined in function definition
ii) statements which are defined in main part of the Pyhton Program
iii)All of above
iv) None of above

9)What is the Full form of CSV?

(i)Common Specified Values ii)Comma Separated Values

iii)Code Specified Values iv)Colon Separated Values

10) Which of the following function is not part of Pickle Module

i) dump() ii) load() iii) print() iv) All of these

Q:2 1 Mark Questions: (1*5=5)

1) What is None Literal in Python?

2) sin () is invoked by importing -

3) What is List Slice?

4) Which function is used for writing data in CSV file?

5) Write how to open a text file with example?

Q:3 2 Marks Questions: (1*2=10)

1) What is local and global scope of a function? How to identify which function has local or
global scope in function.?
2) Write and give brief explanation of type of files.
3) Write and give brief explanation of type of function.
4) Give any two function name and its syntax of Dictionary.
5) What is packing and unpacking of tuple ? Give example.

Q:4 5 Marks Question(Any 3 question) (1*5=15)

1) Write a program to read a record from a binary file.


2) Write a program to open and read a CSV file with all necessary steps.
3) What are the types of Parameter and explain parameter with example.
4) Explain List function and methods with example.

All the Best

**************************************************

You might also like