Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code? >>>max("what are you")
Q2
What will be displayed by print(ord('b') - ord('a'))?
Q3
What will be the output of the following Python code? print("Hello {1} and {0}".format('bin', 'foo'))
Q4
What will be the output of the following Python code? print('a B'.isalpha())
Q5
Say s="hello" what will be the return value of type(s)?
Q6
What will be the output of the following Python code? >>>example = "snow world" >>>print("%s" % example[4:7])
Q7
What will be the output of the following Python code? print(0xA + 0xB + 0xC)
Q8
What will be the output of the following Python code snippet? print('__foo__'.isidentifier())
Q9
What will be the output of the following Python code? print("xyyzxyzxzxyy".endswith("xyy"))
Q10
What will be the output of the following Python code? >>>example="helloworld" >>>example[::-1].startswith("d")
Q11
What will be the output of the following Python code? print("abcdef".center(7, 1))
Q12
What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='')
Q13
What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd', 2))
Q14
To return the length of string s what command do we execute?
Q15
What will be the output of the following Python code snippet? print('{:,}'.format('1112223334'))
Q16
What function do you use to read a string?
Q17
What will be the output of the following Python code snippet? print('The sum of {0} and {1} is {2}'.format(2, 10, 12))
Q18
What will be the output of the following Python code snippet? print('ab'.zfill(5))
Q19
What will be the output of the following Python code? class Name: def __init__(self, firstName, mi, lastName): self.firstName = firstName self.mi = mi self.lastName = lastName firstName = "John" name = Name(firstName, 'F', "Smith") firstName = "Peter" name.lastName = "Pan" print(name.firstName, name.lastName)
Q20
What will be the output of the "hello" +1+2+3?
Q21
What will be the output of the following Python code snippet? print('Ab!2'.swapcase())
Q22
What will be the output of the following Python statement? >>>print('new' 'line')
Q23
What will be the output of the following Python code snippet? print('abcdef12'.replace('cd', '12'))
Q24
What will be the output of the following Python code? print('abcdef'.partition('cd'))
Q25
What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy'))