What will be the output of the following Python code?
print("abcdef".center(7, 1))
print("abcdef".center(7, 1))
Anonymous Quiz
23%
1abcdef
40%
abcdef1
12%
abcdef
25%
error
👍2
What will be the output of the following Python code?
print("abcdef".center(7, '1'))
print("abcdef".center(7, '1'))
Anonymous Quiz
18%
1abcdef
43%
abcdef1
8%
abcdef
31%
error
👍2
What will be the output of the following Python code?
print("abcdef".center(10, '12'))
print("abcdef".center(10, '12'))
Anonymous Quiz
43%
12abcdef12
21%
abcdef1212
12%
1212abcdef
23%
error
🤯2
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy'))
print("xyyzxyzxzxyy".count('yy'))
Anonymous Quiz
62%
2
8%
0
25%
error
5%
none
👍3
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy', 1))
print("xyyzxyzxzxyy".count('yy', 1))
Anonymous Quiz
42%
2
15%
0
33%
1
11%
none
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy', 2))
print("xyyzxyzxzxyy".count('yy', 2))
Anonymous Quiz
44%
2
14%
0
32%
1
10%
none
👍1🤔1
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('xyy', 0, 100))
print("xyyzxyzxzxyy".count('xyy', 0, 100))
Anonymous Quiz
44%
2
18%
0
16%
1
22%
error
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('xyy', 2, 11))
print("xyyzxyzxzxyy".count('xyy', 2, 11))
Anonymous Quiz
32%
2
19%
0
38%
1
12%
error
❤2🔥1
What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('xyy', -10, -1))
print("xyyzxyzxzxyy".count('xyy', -10, -1))
Anonymous Quiz
26%
2
31%
0
18%
1
25%
error
What will be the output of the following Python code?
print('abc'.encode())
print('abc'.encode())
Anonymous Quiz
38%
abc
31%
‘abc’
20%
b’abc’
11%
h’abc’
What is the default value of encoding in encode()?
Anonymous Quiz
37%
ascii
16%
qwerty
42%
utf-8
5%
utf-16
What will be the output of the following Python code?
print("xyyzxyzxzxyy".endswith("xyy"))
print("xyyzxyzxzxyy".endswith("xyy"))
Anonymous Quiz
14%
1
72%
True
7%
3
8%
2
What will be the output of the following Python code?
print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
Anonymous Quiz
8%
0
17%
1
46%
True
29%
False
🤯1
What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs())
print("ab\tcd\tef".expandtabs())
Anonymous Quiz
50%
ab cd ef
22%
abcdef
12%
ab\tcd\tef
16%
ab cd ef
👍2
What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs(4))
print("ab\tcd\tef".expandtabs(4))
Anonymous Quiz
65%
ab cd ef
12%
abcdef
7%
ab\tcd\tef
16%
ab cd ef
What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs('+'))
print("ab\tcd\tef".expandtabs('+'))
Anonymous Quiz
40%
ab+cd+ef
38%
ab++++++++cd++++++++ef
15%
ab cd ef
7%
none of the mentioned
❤2
What will be the output of the following Python code?
print("abcdef".find("cd") == "cd" in "abcdef")
print("abcdef".find("cd") == "cd" in "abcdef")
Anonymous Quiz
57%
True
24%
False
15%
Error
5%
None of the mentioned
What will be the output of the following Python code?
print("abcdef".find("cd"))
print("abcdef".find("cd"))
Anonymous Quiz
41%
True
38%
2
9%
3
13%
None of the mentioned
👍2
What will be the output of the following Python code?
print("ccdcddcd".find("c"))
print("ccdcddcd".find("c"))
Anonymous Quiz
41%
4
40%
0
12%
Error
7%
True
What will be the output of the following Python code?
print("Hello {0} and {1}".format('foo', 'bin'))
print("Hello {0} and {1}".format('foo', 'bin'))
Anonymous Quiz
65%
Hello foo and bin
20%
Hello {0} and {1} foo bin
10%
Error
5%
Hello 0 and 1