What will be the output of the following Python code?
print('1Rn@'.lower())
n
1rn@
rn
r
print("abcdef".find("cd") == "cd" in "abcdef")
True
False
Error
None of the mentioned
>>>max("what are you")
what
y
a
Concatenation
Membership
Slicing
All of the above
List
Tuple
Dictionary
None
strip()
lstrip()
rstrip()
trim()
print("abc DEF".capitalize())
abc def
ABC DEF
Abc def
Abc Def
What will be the output of following statement ?
>>>"m"+"n1"
'm+nl'
'mn1'
'm n1'
'm'
example = "NITIN" print(example.rfind("N"))
-1
4
3
1
What will be the output of the following Python code snippet?
print('ab cd-ef'.title())
Ab cd-ef
Ab Cd-ef
Ab Cd-Ef
print("xyyzxyzxzxyy".count('yy', 1))
2
0
none of the mentioned
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
print('abcdef12'.replace('cd', '12'))
ab12ef12
abcdef12
ab12efcd
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
print('HelloWorld'.istitle())
print('a B'.isalpha())
what will the output of following code
my_string="Hello,world"print(my_string[-6:-1])
,worl
worl
world
oworld
islower()
isupper()
Islower()
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
error
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("abcdef".find("cd"))
print('ab'.isalpha())
print(''.isdigit())
print('a@ 1,'.islower())
print('abcdef'.partition('cd'))
(‘ab’, ‘ef’)
(‘abef’)
(‘ab’, ‘cd’, ‘ef’)
str1[ : : -1 ]
str1[ : : 1 ]
str1[ : -1 : -1 ]
print('abcdefcdghcd'.split('cd', 0))
[‘abcdefcdghcd’]
‘abcdefcdghcd’
print('ab cd ef'.title())
Ab cd ef
Ab cd eF
Ab Cd Ef
length
length()
len()
print('abcdefcdgh'.partition('cd'))
(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
(‘ab’, ‘cd’, ‘efcdgh’)
(‘abcdef’, ‘cd’, ‘gh’)
count()
upper()
उपरोकà¥à¤¤ सà¤à¥€
print("xyyzxyzxzxyy".count('xyy', -10, -1))
print("xyyzxyzxzxyy".count('xyy', 2, 11))
print('xyyzxxyxyy'.lstrip('xyy'))
zxxyxyy
z
zxxy
23
'2+3'
'23'
None of These
All the above
str1="helloworld"print(str1[::-1])
dlrowolleh
hello
helloworld
print s[0]
print s.lower()
s[1]='r'
print s.strip()
slicer
None of these-
19
18
17
x = 'abcd'for i in range(len(x)): x[i].upper()print (x)
abcd
ABCD
print('11'.isnumeric())
Strings can be modified using indexing.
Strings are immutable.
Strings can only contain alphabetic characters.
Strings must end with a newline character.
none of the mentioned.
x = "abcdef"i = "a"while i in x: x = x[:-1] print(i, end = " ")
i i i i i i
a a a a a a
a a a a a
print('Hello!2@#World'.istitle())
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.
print("xyyzxyzxzxyy".endswith("xyy"))
print('abc'.islower())
indexing
Replication
concatenation
None of the Above