ctp_mft
ctp_mft
2. Testing of Hypothesis
(36).What is the probability of making a Type I error
a) Confidence level
b) Level of significance
c) Power of the test
d) Type II error
Answer: b) Level of significance n
(7) What will the following code do python with open('file.txt', 'r') as
f: content = f.read()
a) Write to the file file.txt
b) Read the contents of file.txt
c) Delete the file file.txt
d) Close the file file.txt
(8) Which method is used to create a new directory
a) os.mkdir()
b) os.create()
c) os.makedir()
d) os.newdir()
(9) What does the os.listdir() function do
a) Lists all files in a directory
b) Deletes all files in a directory
c) Moves files between directories
d) Reads the content of a file
(10) How do you delete a file named oldfile.txt
a) os.delete('oldfile.txt')
b) os.remove('oldfile.txt')
c) os.kill('oldfile.txt')
d) os.del('oldfile.txt')
a) def
b) class
c) object
d) new
a) __str__
b) __init__
c) __new__
d) __del__
d) Encrypting data
b) _attr
c) __attr
d) attr_
c) A type of loop
Long Questions
(12) Explain the steps to create and use custom modules and
packages in Python. Illustrate with examples of directory structures
and import methods. [BL2]
(18) Outline the steps involved in working with binary files in Python.
Include examples for both reading and writing binary data. [BL2]
(19) Illustrate file handling in Python using context managers and the
with statement. Show how it improves resource management with
examples. [BL2]
(20) Explain how to check if a file exists and handle file paths in
Python. Use examples with os.path functions. [BL2]
(22) Explain how to write and read CSV files in Python. Demonstrate
this using the csv module with examples. [BL2]
Unit 5 : OOPS
(25) Describe how decorators are used to create class methods and
static methods in Python. Include examples to clarify. [BL2]