Python MCQ For 6th Sem 2020
Python MCQ For 6th Sem 2020
6st Semester
Discipline: ..BACHELOR OF COMPUTER APPLICATION .
Q.No Marks
The figures in the right hand margin indicate full marks.
Candidates are required to give their answers in their own words as far as practicable .
Illustrate the answers wherever necessary .
[20X1=20]
1. Answer any 20 questions.
nums=set([1,1,2,3,3,3,4])
print len(nums)
i)2 ii) 4
iii)5 iv) 7
h. Which one of the following functions replaces all occurrences of old substring in
string with new string?
list=[1, 2, 3, 4, 10]
>>> print (list[-1])
j. Which of the following functions will give the total length of a list?
l. Which of the following will not be correct if tuple=(10, 12, 14, 16, 18)?
m. Which of the following functions in Python is used to convert a string into a tuple?
p. Which of the following functions of the dictionary gets all the values from the dictionary?
i)image files ii)text files iii) exe files iv) non-text file
s. What will be used to open a file in C:/xyz.txt for reading?.
t. At what position will the pointer be placed whenever we open a file for reading or writing?
i) <class, ‘set’> ii) <class, ‘list’> iii) <class, ‘dict’> iv)<class, ‘tuple’>
y. def MyFunction():
“Python is an interesting language”
return 1
print(MyFunction.__doc__[10:12])