Keyword

Result: 213 questions

Which of the following is the output of the below Python code?

str='abababadaadbbaccabc'
print  (str.count('ab',-17,-1))
Quiz

Which of the following is the output of the below Python code?

str='python'
print  (str.center(15,'*'))
Quiz

Which of the following is the output of the following Python code?

str='PYTHON string concepts'
print  (str.title())
Quiz

Which of the following is the output of the below Python code?

print  (u'2.15'.isnumeric())
Quiz

Which of the following is the output of the below Python code?

str='abcdefcdyzcd'
print  (str.split('cd',2))
Quiz

Which of the following print statements will print all the names in the list on a separate line?

identity = ['Python', 'Python quiz', 'Python String', 'Python Interview', 'Python questions']
Quiz

Which of the following is the output of the below Python code?

str='abbabadaadbbaccabc'
print  (str.count('ab',2))
Quiz

Which of the following is the output of the below Python code snippet?

str='PYTHON\nString\nConcepts'
print  (str.splitlines())
Quiz

Which of the following is the output of the following Python instruction?

print  ('am'.zfill(5))
Quiz

Which of the following is the output of the below Python code?

str='Tech Beamers'
print (str[::-1])
Quiz

Which of the following is the output of the below Python code?

str='Hello World'
print (str.find('o'))
Quiz

Which of the following is the output of the below Python code?

class  Assign:
    def __init__(self, value= 0):
       self.__value =value
 
obj1 = Assign(2)
obj2 = Assign(2)
print(id(obj1) == id(obj2))
str1='Good'
str2='Good'
print(id(str1) == id(str2))
Quiz

Which of the following is the output of the below Python code?

str='example'
print  (str.center(2,'*'))
Quiz

Which of the following is the output of the below Python code?

str='Tech Beamers'
print (str[4:9])
Quiz

Which of the following is the output of the below Python code?

str='Hello World'
print  (str.replace('l','n',2))
Quiz

Which of the following is the output of the below Python code?

str='Tech Beamers'
str[4]='-'
print (str)
Quiz

Which of the following is the output of the below Python code?

list1 = [1, 3]
list2 = list1
list1[0] = 4
print(list2)
Quiz

Which of the following is the output of the below Python code?

class parent:
    def __init__(self, param):
        self.v1 = param

class child(parent):
    def __init__(self, param):
        self.v2 = param

obj = child(11)
print ("%d %d" % (obj.v1, obj.v2))
Quiz

Which is the output of the following Python code fragment?

x = True
y=False
z= False

if not x or y:
      print (1)
elif not x or not y and z:
      print (2)
elif not x or y or not y and x:
      print (3)
else:
      print (4)
Quiz

Which of the following is the output of the below Python code fragment?

class A:
    def __init__(self):
        self.i = 1
    def m(self):
        self.i = 10
class B(A):
    def m(self):
        self.i += 1
        return self.i
def main():
    b = B()
    print(b.m())
main()
Quiz

© 2017 QuizBucket.org