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