Professional Documents
Culture Documents
Which of the following function of dictionary gets all the values from the dictionary?
Which of the following operator in python evaluates to true if the variables on either side
of the operator point to the same object and false otherwise?
Find the missing term (?) for the following output of the given code?
Code −
q = 'vwxyz'
for i in range(len(q)):
print(?)
q = ‘?’
Which of the following function returns the max alphabetical character from the string
str?
A - 3
B - 13
C - 17
D - 16
elect the code for the following output?
A - T T T T
B - T U T O R I A L S P O I N T
C - r r r r r r r r...
D - TutorialsPoint
Q - What is the output of 3 in [1, 2, 3]?
A - true
B - false
C - Error
D - None of the above.
Q - Which of the following operator in python evaluates to true if it does not finds a
variable in the specified sequence and false otherwise?
A - **
B - //
C - is
D - not in
Q - What is output for − max(''please help '')
A - s
B - a blank space character
C - e
D - p
Q - Which of the following function convert an object to a string in python?
A - int(x [,base])
B - long(x [,base] )
C - float(x)
D - str(x)
Q - What is output of −
33 == 33.0
A - False
B - True
C - 33
D - None of the above
Q - Which is the special symbol used in python to add comments?
A - $
B - //
C - /*.... */
D - #
Q - Select the correct code to create a check button under parent frame1 and it should
be bind to v1?
A - CheckButton(frame1, text=''Bold'' , command=CheckButton)
B - Checkbutton(frame1 , text=''Bold’’ ,variable=v1 ,command=processCheckbutton)
C -
Checkbutton(frame1,text=''Bold'',variable=v1.set(),command=v1.set(processCheckbut
ton)
D - Checkbutton(frame.set(f1) ,text.set(''bold'') ,command=v1.set(processCheckbutton)
Q - Which method is used to convert raw byte data to a string?
A - Encode()
B - Decode()
C - Convert()
D - tostring()
Q - Using the pack manager, how you can you put the components in a container in
the same row?
A - Component.pack(side= ''LEFT'')
B - Component.pack(''Left '')
C - Component.pack(side=LEFT)
D - Component.pack(Left-side)
Q - Which code can be used as an input dialog named ''Is this a character? ''
A - Tkinter.messagebox.showinfo(''showinfo'' , ''Is this a character? '')
B - Tkinter.messagebox.askyesno(''askyesno'' , ''Is this a character? '')
C - Tkinter.messagebox.showerror(''showerror'' , ''Is this a character? '')
D - Tkinter.messagebox.showwarning(''showwarning'' , ' 'Is this a character? '')
Q - Which of the following function checks in a string that all characters are in
uppercase?
A - isupper()
B - join(seq)
C - len(string)
D - ljust(width[, fillchar])
Q - What is the following function compares elements of both dictionaries dict1, dict2?
A - max(dict)
B - min(dict)
C - len(dict)
D - None of the above.
Q - What is output for −
a = ['hat', 'mat', 'rat']
'rhyme'.join(a)
A - [‘hat’,’mat’,’rat’,’rhyme’]
B - ‘hatmatratrhyme’
C - [‘hat mat rat rhyme’]
D - ‘hatrhymematrhyme rat’
Q - Which among them is correct(s) about Recursive Function?
A - They are much faster than the normal functions.
B - They take more space then the non-recursive functions.
C - They can always be replaced by non-recursive functions.
D - Using recursive functions however also gives a natural and straight forward simple
solution for the program.
Q - What is output of following code −
s = ''mnopqr ''
i = ''m ''
while i in s:
print('i', end= '' '')
A - i i i i i i i i……..
B - m m m m m …..
C - m n o p q r
D - no output
Q - How can we generate random numbers in python using methods?
A - random.uniform ()
B - random.randint()
C - random.random()
D - All of the above
Q - What will be the output of the following code?
def f():
pass
print(type(f()))