What will be the output of the following Python code snippet?
print('HelloWorld'.istitle())
True
False
None
Error
What will be the output of the following Python code?
print("abcdef".find("cd"))
2
3
None of the mentioned
example = "helle"print(example.find("e"))
-1
1
0
print('xyyzxxyxyy'.lstrip('xyy'))
error
zxxyxyy
z
zxxy
x = 'abcd'for i in x: print(i) x.upper()
a B C D
a b c d
A B C D
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
none of the mentioned
matches a pattern at the start of the string.
matches a pattern at any position in the string.
such a function does not exist
print('abcdef12'.replace('cd', '12'))
ab12ef12
abcdef12
ab12efcd
str1="helloworld"print(str1[::-1])
dlrowolleh
hello
world
helloworld
print('abef'.replace('cd', '12'))
abef
12
print('abcdefcdghcd'.split('cd', -1))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
print('1Rn@'.lower())
n
1rn@
rn
r
print("abcdef".find("cd") == "cd" in "abcdef")
print(max("what are you"))
u
t
y
print('abef'.partition('cd'))
(‘abef’)
(‘abef’, ‘cd’, ”)
(‘abef’, ”, ”)
count()
strip()
upper()
उपरोकà¥à¤¤ सà¤à¥€
print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
xyyxyyxyxyxxy
12y12y1212x12
print('abcdefcdgh'.partition('cd'))
(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
(‘ab’, ‘cd’, ‘efcdgh’)
(‘abcdef’, ‘cd’, ‘gh’)
print("Welcome to Python".split())
[“Welcome”, “to”, “Python”]
(“Welcome”, “to”, “Python”)
{“Welcome”, “to”, “Python”}
“Welcome”, “to”, “Python”
print('Hello!2@#World'.istitle())
none of the mentioned.
All the above
indexing
Replication
concatenation
None of the Above
find()
copy()
capitalize()
print('ab cd ef'.title())
Ab cd ef
Ab cd eF
Ab Cd Ef
print s[0]
print s.lower()
s[1]='r'
print s.strip()
x = "abcdef" i = "a" while i in x[:-1]: print(i, end = " ")
a a a a a
a a a a a a
a a a a a a … infinite Time
a
x = "abcdef"i = "a"while i in x: x = x[:-1] print(i, end = " ")
i i i i i i
print('abcefd'.replace('cd', '12'))
ab1ef2
abcefd
ab1efd
ab12ed2
print("xyyzxyzxzxyy".count('xyy', -10, -1))
print('abc'.islower())
print('ab'.isalpha())
What does the following code print ?
x = 'mohan'for i in range (len(x)): x[i].upper()print (x)
mohan
MOHAN
None of These
slicer
Slicing
Membership
None of these-
string = "my name is x"for i in string: print (i, end=", ")
m, y, , n, a, m, e, , i, s, , x,
m, y, , n, a, m, e, , i, s, , x
my, name, is, x,
print('11'.isnumeric())
print('1.1'.isnumeric())
x = 'abcd'for i in range(len(x)): x[i].upper()print (x)
abcd
ABCD
print("xyyzxyzxzxyy".count('yy', 1))
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
>>>max("what are you")
what
print("abc DEF".capitalize())
abc def
ABC DEF
Abc def
Abc Def
length
length()
len()
startswith()
startswith_prefix()
startswithwith()
startswiths()
str1[ : : -1 ]
str1[ : : 1 ]
str1[ : -1 : -1 ]
a = [0, 1, 2, 3]for a[0] in a: print(a[0])
0 1 2 3
0 1 2 2
3 3 3 3
string = "my name is x"for i in string.split(): print (i, end=", ")
dlroWolleH
Hello Worl
d
space
colon
semi colon
x = "abcdef"i = "a"while i in x: x = x[1:] print(i, end = " ")
no output