Removes all spaces from the string.
Removes the first and last character of the string.
Removes whitespace from the beginning and end of the string.
Converts the string into a list of characters.
What will be the output of following statement ?
>>>"m"+"n1"
'm+nl'
'mn1'
'm n1'
'm'
What will be the output of the following Python code snippet?
print('abcdefcdghcd'.split('cd'))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
What will be the output of the following Python code?
x = "abcdef"i = "a"while i in x: x = x[1:] print(i, end = " ")
a a a a a a
a
no output
error
print('Hello World'.istitle())
True
False
None
Error
print('ab,12'.isalnum())
example = "helle"print(example.find("e"))
-1
1
0
print('abcdef'.partition('cd'))
(‘ab’, ‘ef’)
(‘abef’)
(‘ab’, ‘cd’, ‘ef’)
2
what will the output of following code
my_string="Hello,world"print(my_string[-6:-1])
,worl
worl
world
oworld
What does the following code print ?
x = 'mohan'for i in range (len(x)): x[i].upper()print (x)
mohan
MOHAN
None of These
x = "abcdef" i = "a" while i in x[:-1]: print(i, end = " ")
a a a a a
a a a a a a … infinite Time
count()
upper()
strip()
All the above
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
none of the mentioned
print('a B'.isalpha())
print('1Rn@'.lower())
n
1rn@
rn
r
print('xyyzxxyxyy'.lstrip('xyy'))
zxxyxyy
z
zxxy
List
Tuple
Dictionary
print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
x = "abcdef"i = "a"while i in x: x = x[:-1] print(i, end = " ")
i i i i i i
print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
xyyxyyxyxyxxy
12y12y1212x12
print('cd'.partition('cd'))
(‘cd’)
(”)
(‘cd’, ”, ”)
(”, ‘cd’, ”)
length
length()
len()
str1="helloworld"print(str1[::-1])
dlrowolleh
hello
helloworld
dlroWolleH
Hello Worl
d
उपरोकà¥à¤¤ सà¤à¥€
print('ab'.isalpha())
wd[4:]
wd[:4]
wd[-5:]
wd[:-4]
print('a@ 1,'.islower())
example = "snow world"example[3] = 's'print (example)
snow
snow world
snos world
indexing
Replication
concatenation
None of the Above
print('xyxxyyzxxy'.lstrip('xyy'))
xyxxyyzxxy
xyxzxxy
print('abef'.replace('cd', '12'))
abef
12
19
18
17
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
print('abcdefcdghcd'.split('cd', -1))
print("abcdef".find("cd"))
3
None of the mentioned
What will be the output of the following expression?
a = 2b = 8print(a|b )print(a >> 1)
10 0
10 2
2 2
10 1
White Space
,
e
S
print('ab cd-ef'.title())
Ab cd-ef
Ab Cd-ef
Ab Cd-Ef
print("xyyzxyzxzxyy".count('yy', 1))
slicer
Slicing
Membership
None of these-
print("xyyzxyzxzxyy".endswith("xyy"))
print('abcdefcdgh'.partition('cd'))
(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
(‘ab’, ‘cd’, ‘efcdgh’)
(‘abcdef’, ‘cd’, ‘gh’)
What is the output of the following program:
print ("Hello World"[::-1])
dlroW olleH
D
index()
find()
Both of the above
None of the above
print('11'.isnumeric())
matches a pattern at the start of the string.
matches a pattern at any position in the string.
such a function does not exist
none of the mentioned.
x = 'abcd'for i in range(len(x)): x[i].upper()print (x)
abcd
ABCD
print("abcdef".find("cd") == "cd" in "abcdef")