count()
upper()
strip()
All the above
What will be the output of the following Python code snippet?
print('abcdefcdghcd'.split('cd', -1))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
print('abef'.partition('cd'))
(‘abef’)
(‘abef’, ‘cd’, ”)
(‘abef’, ”, ”)
error
What will be the output of the following Python code?
print('ab,12'.isalnum())
True
False
None
Error
dlroWolleH
Hello Worl
d
print('xyxxyyzxxy'.lstrip('xyy'))
zxxy
xyxxyyzxxy
xyxzxxy
none of the mentioned
print('abef'.replace('cd', '12'))
abef
12
string = "my name is x"for i in string.split(): 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('ab cd ef'.title())
Ab cd ef
Ab cd eF
Ab Cd Ef
None of the mentioned
List
Tuple
Dictionary
print('abcdefcdgh'.partition('cd'))
(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
(‘ab’, ‘cd’, ‘efcdgh’)
(‘abcdef’, ‘cd’, ‘gh’)
x = "abcdef"i = "a"while i in x: x = x[1:] print(i, end = " ")
a a a a a a
a
no output
islower()
isupper()
Islower()
print('abcdefcdghcd'.split('cd', 2))
[‘ab’, ‘ef’, ‘ghcd’]
[‘ab’, ‘efcdghcd’]
[‘abcdef’, ‘ghcd’]
print('Hello!2@#World'.istitle())
Strings can be modified using indexing.
Strings are immutable.
Strings can only contain alphabetic characters.
Strings must end with a newline character.
print('a B'.isalpha())
print("Welcome to Python".split())
[“Welcome”, “to”, “Python”]
(“Welcome”, “to”, “Python”)
{“Welcome”, “to”, “Python”}
“Welcome”, “to”, “Python”
What is the output of the following program:
print ("Hello World"[::-1])
dlroW olleH
D
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
print('1.1'.isnumeric())
print('11'.isnumeric())
print("abc DEF".capitalize())
abc def
ABC DEF
Abc def
Abc Def
example = "NITIN" print(example.rfind("N"))
-1
4
3
1
print('Hello World'.istitle())
str1="helloworld"print(str1[::-1])
dlrowolleh
hello
world
helloworld
delete all the trailing whitespace characters
delete all the leading whitespace characters
delete all the leading and trailing whitespace characters
delete upper case characters
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
23
'2+3'
'23'
None of These
print("xyyzxyzxzxyy".count('xyy', 2, 11))
2
0
print('HelloWorld'.istitle())
उपरोकà¥à¤¤ सà¤à¥€
length
length()
len()
print('abcefd'.replace('cd', '12'))
ab1ef2
abcefd
ab1efd
ab12ed2
print("xyyzxyzxzxyy".count('yy', 1))
>>>max("what are you")
what
y
19
18
17
x = 'abcd'for i in range(len(x)): x[i].upper()print (x)
abcd
ABCD
print('abcdef'.partition('cd'))
(‘ab’, ‘ef’)
(‘ab’, ‘cd’, ‘ef’)
what will the output of following code
my_string="Hello,world"print(my_string[-6:-1])
,worl
worl
oworld
string = "my name is x"for i in string: print (i, end=", ")
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
x = "abcdef"i = "a"while i in x: x = x[:-1] print(i, end = " ")
i i i i i i
print('cd'.partition('cd'))
(‘cd’)
(”)
(‘cd’, ”, ”)
(”, ‘cd’, ”)
x = 'abcd'for i in x: print(i) x.upper()
a B C D
a b c d
A B C D
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.
space
colon
semi colon
print('a@ 1,'.islower())
anywhere in between the file
End
beginning
second line of the file
print("xyyzxyzxzxyy".count('xyy', -10, -1))