Professional Documents
Culture Documents
name = "maria"
if name == "melissa":
32 print("usa") melissa mary colombia ireland C
elif name == "mary":
print("ireland")
else:
print("colombia")
33 Which of the following is not used as loop in Python? for loop while loop do-while loop None of the above C
What will be the output of the following Python code?
i=5
while True:
34 if i%3 == 0: 5 7 9 11 13 … 5 7 579 Error B
break
print(i)
i += 2
What will be the output of following code?
2, 1, 0, -1, -2, -3, -4,
35 2, 1, 0 2, 1, 0, -1, -2 2, 1, 0, -1, -2, -3 C
for num in range(2,-3,-1): -5
print(num, end=", ")
What will be the output of the following Python code?
36 d = {"john":4, "harry":45} 4 45 “john” “harry” A
print(d["john"])
What does the following code print to the console?
if False:
print("Nissan")
elif True:
37 Nissan Ford BMW Audi B
print("Ford")
elif True:
print("BMW")
else:
print("Audi")
Keyword
No loop can be used "continue" is used Keyword "break"
Loops should be
to iterate through to continue with the can be used to bring
38 Which of the following is True regarding loops in Python? ended with D
the elements of remaining control out of the
keyword "end".
strings. statements inside current loop.
the loop.
What is the output of the following nested loop
for num in range(10, 14): 10
10
for i in range(2, num): 11 10
39 11 10 A
if num%i == 1: 12 11
12
print(num) 13
break
40 while(0), how many times the loop will run? 0 1 3 Infinite A
X=100
Y=200
41 ---x>y---print(“In if”) if,:,else: else, if all the of above None of the above A
-------prin(“In else”)
47 Python uses --------------to form a block of code break comments Selection statement indentation D
A series of if-elif statements have a final----------block, which is executed if none
48 nested if else elif nested if , if, if else D
of the if or elif expressions is True
49 Python assumes any non-zero and non-null values as--------- TRUE FALSE A
50 --------statements are used to repeatedly execute one or more statements in a block First statement All the statements Iterative None of these C
51 If the condition in the while loop never becomes False, then it will result in an----- Syntax Error Infinite loop executing bug B
-----loop can be used when the number of times the statements in loop has to be
52 break continue while pass C
executed is not known in advance
53 -------loop is called a definite loop ; . for , C
54 when a for loop is used, a --------of sequence is specified Curly brackets range Colon None of the above B
55 ----------is a built-in function that is used to iterate over a sequence of numbers Entry control loop Exit control loop Selection statement range( ) D
56 If your requirement is to have a counter-controlled loop, then choose----loop for break continue jump A
It will stop You will have to
57 To specify an empty body of a for loop,you will use------statement It would run forever pass D
executiong press Ctrl+C
Fill in the blanks to create a for loop that prints only the odd values in the range:-----
-I in range(0,20,):
58 print(-------) for,2*i+1 for 2+i for i+2*1 2*i A
Dictates what
Defines program-
happens before the
59 A--------statement contains other statements specific data compound None of the above B
program starts and
structures
after it terminates
60 --------begin with a keyword and end with a colon Headers For Loop While loop All of the above A
61 Indentation identifies a statement block TRUE FALSE A
62 You can not use logical operators in if statement condition TRUE FALSE B
63 Statement in if-else block should be properly aligned TRUE FALSE A
64 You can use floating point numbers for checking for equality in the test expression TRUE FALSE B
65 It is necessary that every if statement should have an else block TRUE FALSE B
66 elif and else blocks are optional TRUE FALSE A
While forming the condition expression ,we should use positive statements
67 TRUE FALSE A
rather than using compound negative statement
The while loop is used to repete one or more statements while a paricular
68 TRUE FALSE B
condition is False
If the control condition evaluates to False,then the statements enclosed in the loop
69 are TRUE FALSE A
never executed
Every alternate item of the sequence is assigned to the loop control variable one
70 TRUE FALSE B
after the other
71 The step argument in range () can be zero TRUE FALSE B
72 A sentinel controlled loop can be implemented using the for loop TRUE FALSE A
73 Loops can be nested to any desired level TRUE FALSE A
74 You can use break or continue statement outside loop TRUE FALSE B
75 pass is a null statement TRUE FALSE A
76 You can have the else statement associated with loop statement TRUE FALSE A
In a while loop ,if the body is executed n times then test expression is executed
77 TRUE FALSE A
n+1 times
The number of time the loop control variable is updated is equal to the number of
78 times TRUE FALSE A
loop iterates
79 In the while loop ,the loop control variable is initialized in the body of loop TRUE FALSE B
80 All if statements must contain eigther an else statement TRUE FALSE B
Which statement is used to terminate the execution of the nearest enclosing loop in
81 B
which it appears? pass break continue jump
The statement is used to stop the currrent iteration of the loop and continues with
82 C
the next one? pass break continue jump
while False:
83
print("Hello") Hello No output
84 Statement within a suite can be intended a different amount TRUE FALSE B
Find output:
years = 200
if (years == 100):
print( "Century")
elif (years == 75):
print ("Platinum Jublee")
elif (years == 50):
85 print ("Half Century") Nothing
elif (years == 25):
print("Silver Jublee")
elif(years == 10):
print("Decade")
else:
print ("Nothing")
num = 100
if num > 30:
print("30")
86 if num<50: 30
print("50")
if num==7:
print("70")
x=100
if x == 50:
87 print("Yeah") Try Again
else:
print("Try Again")
num = 100
if (num + 1) > 100:
if (num * 2) >= 200:
88 You win
print( "You win")
else:
print( "Try Again")
num = 70
if num == 50:
print( "50")
elif num == 10:
89 print( "10") 70
elif num == 70:
print( "70")
else:
print("Number is not 50, 10 or 70")
if(10 == 10) and (10+20>30):
print("Done")
90 Do It
else:
print("Do It")
91 >>> not 10>70 TRUE
if not True:
print("10")
elif not(10+10 == 30):
92 20
print("20")
else:
print("30")
if 10 + 30 == 60:
print("Best")
93 Worst
else:
print("Worst")
a = 10
b = 20
if not 10 + 10 == b or a == 40 and 70== 80:
94 No
print ("Yes")
elif a != b:
print("No")
i=1
while i<=6:
95 print(i, end = " ") 1 2 3 4 5 6 Done
i=i+1
print("Done")
i=0
while i<10:
i=i+1
if(i == 5): 1234
print("\n Continue") Continue
96 continue 6
if(i==7): Breaking Done
print("\n Breaking")
break
print( i, end = " ")
print( "\n Done")
for i in range(5):
97 hello! hello! hello! hello! hello!
print("hello!", end = " ")
for i in range(10): 2
98 if not i%2==0: 4
print(i+1) 6
Dr. D. Y. Patil Institute of Technology, Pimpri, Pune -18
Department of First Year Engineering
Sub: Programming and Problem Solving
Unit - 3 MCQ
19 Variable length argument is useful when exact number of arguments passed are not known. FALSE TRUE B
20 One function can be written inside another function TRUE FALSE A
A module is a file consisting of Python code. A module can define functions, classes and
21 FALSE TRUE B
variables.
22 User defined functions are created by using ___ keyword. return def import create B
Function definition
23 ____ consists of a function header followed by function body. Function call Package Program A
Function definition
24 _____ is used to uniquely identify the function. Function call Function name Program A
What is the output of the following segment
25 A a 65 Error A
print ( chr ( ord ( ‘A’) ) )
function definition
26 After the called function is executed, the control is returned back to the ____ lambda function Module Calling function D
27 Before calling a function, you must ___ it. call define return pass parameter B
28 Large programs usually follow WET principle. TRUE FALSE B
29 DRY principle makes the code __ Reusable Loop forever Bad and repetitive Complex A
def function_name( function_name( function_name(arguman
30 Which is the correct syntax for function call. function_name D
argumnts) arguments) call ts )
A function is a block of organised and reusable program code that performs multiple, related, multiple, related, well single, specific, well
31 single, small, dependent C
a ___ , _____ and _____ task. dependent defined defined
def person(name,
32 Which of the following function header is example of Default Argument? def person(name, age): def car(model, cost): def sum(a, *tup): B
age=18):
Number of arguments
in the function call
The arguments are
should exactly match One or more arguments
33 What are the characteristics of required arguments? passed to the function in a & b both D
with the number of may be skipped.
correct positional order.
arguments specified in
the function definition
33. def person(name, age, salary):
print(“Name: ”, name)
print(“Age: ”, age) person(salary=50000, person(‘Amit’ , 30,
34 person(‘Amit’ , 30) None of the above A
print(“Salary: ”, salary) name=”Ajay”, age=30) 50000)
which of the following is example of function calling in Keyword argument?
* symbol is used to
Number of arguments
Number of arguments in specify variable-length
37 What are the characteristics of Variable-length Arguments? in call are not fixed Option b & c both D
call are fixed length argument in function
length
header
What is the output of following Program?
def fun(a, *tup):
res = a
for i in tup:
38 10 20 24 12 C
res = res * i
print(res)
fun(1, 2, 3, 4) # call to function fun()
41 In range(0,100,5) name of the function is------and it has----arguments range,3 range,2 range,4 None of these A
42 --------error is causedby importing an unknown module ExportError ImportError Both a & b None B
43 ---------consists of a function header followed by function function name Parameter list return value Function definition D
44 user defined functions are created by using the ____keyword lambda def user None of these B
45 The_____is used to uniquely identify the function arguments calling function function name All of these C
46 The --------describe what the function does. docstring keyword called function Both A & B A
Fill in the blanks to define a function name display--------------
47 display( )-----------print def, : deff, : definition, : function name , : A
("Hello World")
48 After the called function is executed, the control is returned back to the-------- called program calling program return value parameter list B
49 A return statement with no arguments is the same as return ------ 0 3 None 2 C
50 Before calling a function, you must ------------it. call it return it call again define D
--------variable can be accessed from point of its definition until the end of the function in
51 global local # None of these B
which it is defined.
52 To define a variable defined inside a function as global,------statement is used. local variable global All of these C
53 Every function has an implicit------statement as the last instruction in the function body called program calling program return def C
54 Any formal parameters written after the variable - length arguments must be ------arguments default argument required argument variable length argument keyword-only D
55 --------are not declared as other functions using the def keyword Lambda functions user defined function local function global function A
56 This docstring specified can be accessed through the -----attribute of the function document documentation -----doc----- All of these C
57 You can find the name of a module by using the -----attribute of the module keyword Parameter list function name ----name----- D
58 ----------is a built-in function that lists the identifiers defined in a module random( ) print( ) sqrt( ) dir( ) D
59 Every package in python is a directory which must have a special file called--------- init----- -----init--- -----init----.py .py C
Packages have an attribute-------which is initialized with a list having the name of the directory #package
60 ----path---- import Module B
holding the ------init----.py file
Fill in the blanks to define a function that takes two arguments and prints their sum--------------
61 def, :, y lambda, : ,x+y x+y None of these A
mult(x,y)------------print(x*---)
Fill in the blanks to define a function that prints "Positive", if its parameter is greater than 0
and "Negative " otherwise
--------pos_neg(x):
62 if x>0: def,print, else: if, else print( ) deff A
-----------("Positive")
--------
print(" Negative ")
Fill in the blanks to define a function that compares the length of its arguments and returns the
longest one.
def max_len(x,y):
63 if len(x) >=-----(y): return len len, return, return None of these C
--------x
else:
---------y
Fill in the blanks to pass the function cube as an argument to the function "test".------cube(x):
return x*x*x
64 def do (func, x)------ lambda, :, cube def,:, cube x*x*x All of these B
print(func(x))
do(---------,2)
frommath import sqrt,
65 To import the sqrt and cos function from the math module, write-------- import math from import sqrt( ), cos( ) B
cos
66 python's preinstalled modules forms the --------- standard function standard modules standard library standards C
Fill in the blanks to calculate x*(x+1)using lambda function and call it for the number 10 res
67 =(-------x: x------(x+1))-------- lambda, *, (10) lambda, *, (12) lambda, *, (14) None of these A
print(res)
68 The -----command is used to force the reloading of a given module upload reload download All of these B
69 -------,---------, and ------namespaces may exist during te execution of any given python program local global Built-in, global, local Built-in C
How many times print statement executes
def display ():
print('a')
70 print('b') 1 2 3 4 B
return
print('c')
print('d ')
import random as r
71 An error occures 1 10 Any random value A
print(random.randomint(1,10))
72 How would you refer to the sqrt function if it was imported by writing like this___ square_root math.sqrt sqrt square_root B
how many numbers are display def
display(x):
for i in range(x):
73 0 1 9 10 D
print(i)
return
display(10)
74 Which statement invokes the function? Function Defination Function call Function header __doc__ B
75 __of variable determines the part of the in which it is accessible Scope Lifetime Data type Value A
76 Arbitrary arguments have which symbol in the function defination before the parameter name & # % * D
77 Modules are files saved with ____ extension .py mod md1 imp A
78 This import * statement import all names in the module except those beginning with__ % $ _ ! C
79 PyPI stands for Python Project Index Python Package Installer Python Package Index Package Python Installer C
80 Identify the correct way of calling a function named display() that prints Hello on the screen print(display) displayHello result=display() displayHello() C
81 Which keyword is used for function define fun def function C
82 Which of the following items are present in the function header? function name parameter list return value Both A and B D
83 If return statement is not used inside the function, the function will return None 0 Null Abitrary Value A
84 Which of the following function headers is correct? def fun(a = 2, b = 3, c) def fun(a = 2, b, c = 3) def fun(a, b = 2, c = 3) def fun(a, b, c = 3, d) C
function
85 Which one of the following is the correct way of calling a function? function_name() call function_name() ret function_name() A
function_name()
86 Which operator is used in Python to import modules from packages? . * ^ $ B
Lambda is a function in
87 Lambda is function in python TRUE FALSE python but user can not None of these A
use it.
Id returns the identity of Every object doesn’t
88 Which of the following is the use of id() function in python? All of above None of these A
the object have a unique id
Find Output
num = 10
def show():
var = 20
In Function var is - 10
89 print("In Function var is - ", num)
Outside function, var is - 10
show()
print("Outside function, var is - ", num)
def f():
s = "Hello World!"
print(s)
Hello World!
90
Welcome to Python Programming
s = "Welcome to Python Programming"
f()
print(s)
def f():
global var
print(var)
var = 10 100
91
print(var) 10
var = 100
f()
def sqr(x):
print(x*x)
92 100
sqr(10)
def mul_twice(x,y):
print(x*y)
50
93 print(x*y)
50
mul_twice(5, 10)
def func():
global x
print("x =", x)
x = 100 x = 10
94 print('x is now = ', x) x is now = 100
x = 100
x = 10
func()
print('x =', x)
def func1():
var = 3
func2(var)
def func2(var):
95 3
print(var)
func1()
def func(x):
print('x = ', x)
x = 100
x = 50
print('In Function, x after modification = ', x)
96 In Function, x after modification = 100
Outside Function, x = 50
x = 50
func(x)
print('Outside Function, x = ', x)
def sum(num1, num2):
total = num1 + num2
print("Inside function, Total = ", total)
Inside function, Total = 30
return total
97 Outside the function, Total = 30
total = sum(10, 20)
print("Outside the function, Total = ", total)
def min(x,y):
if x<y:
return x
98 else: 4
return y
print(min(4, 7))
def func():
"""Do nothing.
Do nothing.
103 Nothing doing. """
pass Nothing doing.
print(func.__doc__)
def is_even(x): if x==0:
return True
else:
return is_odd(x-1)
104 TRUE
def is_odd(x):
return not is_even(x)
print(is_even(22))
True or False
105 It is mandatory to place all import statements at the beginning of a module. TRUE FALSE B
With the "import modulename" statement, any item from the imported module must be
106 TRUE FALSE A
prefixed with module name.
107 All python standard library modules must be imported before any programmer-defined modules. TRUE FALSE B
If a particular module is imported more than once in a python program, the interpreter will load
108 TRUE FALSE A
the module only once
109 A function can be called from anywhere within a program. TRUE FALSE A
110 A statement can call more than one function. TRUE FALSE A
111 Function calls may contain arguments that are function calls. TRUE FALSE A
112 All functions that returns a value must accept atleast one parameter. TRUE FALSE B
113 Docstring can contain multiple lines of text. TRUE FALSE A
114 Every function can be written more or less indenpendently of the others. TRUE FALSE A
115 When function call is encountered , the control jumps to the calling function. TRUE FALSE B
116 A function can call only one function TRUE FALSE B
117 code reuse is one of the most prminent reason to use function. TRUE FALSE A
118 Large program usually follow the WET principle. TRUE FALSE B
119 we can have a function that does not take any inputs at all . TRUE FALSE A
120 The calling function may or may not pass pararmeters to the called function. TRUE FALSE A
121 The return statement is optional TRUE FALSE A
122 Python does not allow you to assign the function name to variable. TRUE FALSE B
123 Names of variable in function call and header of function definition may vary. TRUE FALSE A
124 Arguments may be passed in the form of expressions to the called function. TRUE FALSE A
125 You can have a variable with the same name as that of a global variable in the program. TRUE FALSE A
126 You should make extentsive use of global variables & global statements. TRUE FALSE
127 The return statement can be used outside of a function definition. TRUE FALSE B
128 Any code written after the return statement is never excuted. TRUE FALSE A
129 The order of keyword argument is not importatnt. TRUE FALSE A
130 Default argument should always be written after the non default arguments. TRUE FALSE A
131 You can specify only one default argument in your function. TRUE FALSE B
The variable length argument if present in the function definition should be first in the list of
132 TRUE FALSE B
formal parameters.
133 A function can not be used on th left side of an assignment statement. TRUE FALSE B
134 Lambda functions are throw- away functions. TRUE FALSE A
135 Lambda functions can be used wherever function objects are required . TRUE FALSE A
136 Lambda functions can not access global variables. TRUE FALSE A
137 Lambda function performs better than regular functions. TRUE FALSE B
A recursive function takes more memory & time to execute as compared to its non-recursive
138 TRUE FALSE A
counterpart.
Dr. D. Y. Patil Institute of Technology, Pimpri, Pune -18
Department of First Year Engineering
Sub: Programming and Problem Solving
Unit - 4 MCQ
21
If a class has one class variable,then how many copies will be created for that variable? 0 1 n infinite B
Which variables are usually used to keep a count of number of objects created from a
22 class? classes objects ordinary temporary A
23 Which method is automatically invoked when an object is about to be destroyed? _init_() _del_() _call_() _repr_() B
24 Which error is generated when an attempt is made to access an undefined method? ValueError NameError AttributeError TypeError C
True or False
A Programming language provides a blueprint to write a program to solve a particular
25 TRUE FALSE B
problem
26 Machine language is lowest level of language TRUE FALSE A
In monolithic paradigm,global data can be accessed and modified from any part of the
27 TRUE FALSE A
program
28 Monolithic programs has two modules TRUE FALSE B
29 Monolithic programs are easy to debug and maintain TRUE FALSE B
30 Structured programming is based on modularization TRUE FALSE A
31 Object oriented programming supports modularization TRUE FALSE A
32 Structured programming heavily used to goto statements TRUE FALSE B
33 Modules enhanced the programmers productivity TRUE FALSE A
34 A structured program takes more time to be written than other programs TRUE FALSE B
35 The interface specifies how to sed a message to the object TRUE FALSE B
36 OOP does not support modulerization TRUE FALSE B
37 A class is a user defined data type TRUE FALSE A
38 TRUE FALSE B
Once a class is declared ,a programmer can create maximum 10 objects of that class
39 Polymorphism means several different forms TRUE FALSE A
Any data or function with access level private can be accessed only by that class or by
40 TRUE FALSE B
any class that inherited from it
41 OOPS helps to develop secured programs TRUE FALSE A
42 It is difficult to manage software complexity in object oriented programs TRUE FALSE B
43 TRUE FALSE A
Programs written using object oriented language have greater processing overhead
44 Python supports OOP TRUE FALSE A
Find output
class Employee:
deptt = 'IT'
def __init__(self, name):
self.name = name
45 Raghav IT
E1 = Employee('Raghav')
print(E1.name, end=" ")
print(E1.deptt)
class Car:
def __init__(self, company, model):
self.company = company
46 Swift Dzire ZX
self.model = model
Dzire = Car('Maruti', 'Swift Dzire ZX')
print(Dzire.model)
class Car:
company = "Maruti"
def __init__(self, model, year = 2016):
self.model = model
47 Company - Maruti, Model - Swift Dzire ZX, Year - 2016
self.year = year
def display(self):
print("Company - %s, Model - %s, Year - %d" %(self.company, self.model, self.year))
Dzire = Car('Swift Dzire ZX')
Dzire.display()
class ABC():
def __init__(self, var):
self. var = var
def display(self):
48 From class method, Var = 10
print("From class method, Var = ", self. var)
obj = ABC(10)
obj.display()
class Person():
def __init__(self, name):
self. name = name
def display(self):
49 print("Good Morning ", self. name) Good Morning Roy
def greet(self):
self.display()
obj = Person("Roy")
obj.greet()
Fill in the blanks
Programming languages have a vocabulary of_____ and______for instructing a
50 syntax, semantics
computer to perform specific tasks.
51 ______ is used to covert assembly level program in to machine language. Assembler
______and_____ are used to translate the instructions written in high level
52 Complier, interpreter
language into computer executable machine language.
53 _______ defines the structures of a program Programming paradigm
54 _______programming emphasizes on classes and objects. Object Oriented
Two examples of languages that support monolithic programming paradigm
55 Assembly language and BASIC
are_____and____
56 Functional abstraction was first supported by _______ programming. Structured
57 An object contains_______ and _______. Data Methods
58 ______ paradigm supports bottom-up approach of problem solving . OOP
59 ______ provides a template that describes the structure and behaviour of an object. Class
60 while______is a logical structure, ________is a physical actuality. Class, Object
61 State defines the ________ values of its attributes at a particular time
62 The data that is transferred with the message is called _________. parameter
the receiver object, the name of the method that the receiver should invoke and the parameters that must be
63 A message consists of _____, _______, and _______.
used with the method
64 Inheritance relation is also called as _________ relation. is-a
65 ______ is related to classes and their hierarchy. Inheritance
66 Polymorphism is related to _________. Methods
Any data or function with access level ______ can be accessed by any function
67 Public
belonging to any class
68 Program written in _______ are robust, secure and reliable. Python
69 In python , the word polymorphism is often is used with _______. Inheritance
Dr. D. Y. Patil Institute of Technology, Pimpri, Pune -18
Department of First Year Engineering
Sub: Programming and Problem Solving
Unit - 6 MCQ
Fill in the blanks to open a file,read its content,and print its length
file=___________("File.txt","r")
text=file._____()
5 open,read,len
print(_______(text))
file.close()
file=open("File.txt", "r")
file.read()
text = file.read()
print(len(text))
32 file.close() 0
str ="Welcome to Python Programming"
file = open("File.txt","w")
n = file.write(str)
33 print(n) 29
file.close()
Blue
36 What will be written in the file?
file.write("Clue".replace('C', 'B')
What will be written in the file?
37 hello
file.write("HELLO".lower())
True or False
38 When a program is being executed, its data is stored in ROM. FALSE
39 Ram is an example of non-volatile memory. FALSE
40 You can have only one root in all the file systems. FALSE
41 Delimiters may vary from one operating System to another. TRUE
42 Folder names and file names are case insensitive in Windows. FALSE
43 Absolute path always contains the root. TRUE
44 The contents of a binary file are human readable. FALSE
Text files includes files like word processing documents,PDF's, spreadsheets,
45
videos, zip files, and other executable programs. FALSE
46 Binary files are more efficient than text files. TRUE
47 *.py files are binary files. FALSE
48 When you open a file for appending that doesnot exist, then a new file is created. TRUE
49 You can open any number of fileswithout any sort of restriction. FALSE
50 The read() starts reading from the beginning of the file. TRUE
If count is missing or have anegative value in the read() then, no contents are read
51
from the file. FALSE
52 The readlines() is used to read all the lines in the file. FALSE
53 The tell() methos moves the file pointer to the new location. FALSE
54 Before removing a directory, it should be absolutely empty. TRUE
os.path.abs() methos accepts a file path as an argument and returns True if the file
55
path is an absolute pathand False otherwise. FALSE
56 The cwd() method is used to display current working directory. FALSE
MCQ Option C Option D Ans
close(fil close("fil file.close
57 Identify the right way to close a file file.close() A
e) e") d
If the file.txt has 10 lines written in it, what will be the result?
58 1 0 10 2 C
len(open("file.txt").readlines())
data
will be
written
to a file error
file will
that has will be
59 If a file opened in 'w' mode does not exist,then nothing will happen be B
name a generate
created
similar d
to the
specified
name
wite("W file.write "Welcom
wite(file,"Welcome to elcome ("Welco e to
60 Identify the right way to write "Welcome to python " in a file? C
python") to me to python".
python",f python") write(fil
A blank
Nothing line is An error
61 What will happen when a file is opened in write mode & then immediately closed? File contents are deleted A
happens written occurs
to the file
secondar
62 A file is stored in ________memory. primary cache volatile B
y
Hard Pen
63 ________ is an example of volatile memory RAM DVD A
disk drive
BTech_C Under
64 In the path C:\Students\Under Graduate\Btech_CS.docx,_____is the sub-folder C: Students D
S Graduate
65 Identify the delimeter in the Solaris file system / \ : | A
66 The default access mode is_______ r w rb wb A
current
python
67 By default, a new file is created in which directory root directory working D drive B
directory
directory
readline( readlines
68 which method is used to read a single line from the file? read() reads() B
) ()
readlines all of
69 which method is used to read to display entire contents of the file read() list() D
() these
In the seek() method, what will be the value of from if you want to specify number
70 0 1 2 3 B
of bytes from the current location of the file pointer?
os.path.b
os.path.r os.path.a
71 Which method returns a string that inculdes everthing specified in the path? os.path.dirname(path) asename( A
elpath() bs()
path)