Professional Documents
Culture Documents
Practice Paper TERM 1
Practice Paper TERM 1
Class XII
Computer Science
TERM-I
M.M 25
Note : Attempt all questions, each question carry 1 mark.
a) 11
b) 12
c) 21
d) 22
a) False
b) True
c) Error, < operator is not valid for tuples
d) Error, < operator is valid for tuples but not if there are sub-tuples
a) 10
b) 0
c) None
d) syntax error
a) 33
b) 22
c) 25
d) none of above
Q 10. Functions that do not return any value are known as:
a) fruitful functions
b) void functions
c) library functions
d) user-defined functions
Q 12. Which is the correct command to load just the temp method from a module
called usable?
a) import usable, temp
b) import temp from usable
c) from usable import temp
d) import temp
Q 14. To read 20 characters from file object FILE at once we may use-
a) FILE.read(20)
b) FILE.readlines(20)
c) FILE.read(char=20)
d) FILE.readline(char=20)
Q 15. read() will return ...................
a) list
b) string
c) tuple
d) dictionary
Q 16. If we do not specify file mode while opening a file, the file will open in
.............mode
a) Read
b) write
c) append
d) will give an error
Q 17. Which of the following mode is used when dealing with non-text files like
image or exe files?
a) Text mode
b) Binary mode
c) csv mode
d) none of the above
Q 21. This method returns an integer that specifies the current position of the file
object.
a) seek()
b) load()
c) position()
d) tell()
Q 22. Which of the following command is used to open a file “c:\temp.txt” for writing
in binary format only?
a) outfile = open(“c:\temp.txt”, “w”)
b) outfile = open(“c:\\temp.txt”, “wb”)
c) outfile = open(“c:\temp.txt”, “w+”)
d) outfile = open(“c:\\temp.txt”, “wb+”)
Q 23. Which of the following options can be used to read the first line of a text file
data.txt?
a) f = open(‘data.txt’)
f.read()
b) f = open(‘data.txt’,’r’)
f.read(n)
c) myfile = open(‘data.txt’)
f.readline()
d) f = open(‘data.txt’)
f.readlines()
Q 24. Which statement will move file pointer 10 bytes backward from current
position?
a) f.seek(-10, 0)
b) f.seek(10, 0)
c) f.seek(-10, 1)
d) None of the above
Q 25. Rishi opened a file in python using open() function but forgot to specify the
mode. In which mode the file will open?
a) write
b) append
c) read
d) read and write both