What will be the output of the following Python code snippet?
print('abc'.islower())
True
False
None
Error
count()
strip()
upper()
उपरोकà¥à¤¤ सà¤à¥€
What will be the output of the following Python code?
print(max("what are you"))
error
u
t
y
5
6
11
print('abef'.partition('cd'))
(‘abef’)
(‘abef’, ‘cd’, ”)
(‘abef’, ”, ”)
23
'2+3'
'23'
None of These
print('abcdef12'.replace('cd', '12'))
ab12ef12
abcdef12
ab12efcd
none of the mentioned
wd[4:]
wd[:4]
wd[-5:]
wd[:-4]
print("abcdef".find("cd"))
2
3
None of the mentioned
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
slicer
Slicing
Membership
None of these-
print('abcdefcdgh'.partition('cd'))
(‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
(‘ab’, ‘cd’, ‘efcdgh’)
(‘abcdef’, ‘cd’, ‘gh’)
print('abcdef'.partition('cd'))
(‘ab’, ‘ef’)
(‘ab’, ‘cd’, ‘ef’)
print('Hello!2@#World'.istitle())
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
print('a@ 1,'.islower())
print('ab,12'.isalnum())
print('a B'.isalpha())
print('abef'.replace('cd', '12'))
abef
12
example = "helle"print(example.find("e"))
-1
1
0
List
Tuple
Dictionary
What will be the output of following statement ?
>>>"m"+"n1"
'm+nl'
'mn1'
'm n1'
'm'
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
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
indexing
Replication
concatenation
None of the Above
print('abcdefcdghcd'.split('cd', -1))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
empty string
complete string
string of six characters
None of the above
What does the following code print ?
x = 'mohan'for i in range (len(x)): x[i].upper()print (x)
mohan
MOHAN
print("xyyzxyzxzxyy".count('xyy', 2, 11))
print('abcdefcdghcd'.split('cd', 0))
[‘abcdefcdghcd’]
‘abcdefcdghcd’
print('HelloWorld'.istitle())
print(''.isdigit())
x = "abcdef"i = "a"while i in x: x = x[1:] print(i, end = " ")
no output
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.
anywhere in between the file
End
beginning
second line of the file
print('abcdefcdghcd'.split('cd', 2))
[‘ab’, ‘ef’, ‘ghcd’]
[‘ab’, ‘efcdghcd’]
[‘abcdef’, ‘ghcd’]
str1[ : : -1 ]
str1[ : : 1 ]
str1[ : -1 : -1 ]
print('abcdefcdghcd'.split('cd'))
print("abcdef".find("cd") == "cd" in "abcdef")
length
length()
len()
find()
copy()
capitalize()
islower()
isupper()
Islower()
print('ab cd ef'.title())
Ab cd ef
Ab cd eF
Ab Cd Ef
print('xyxxyyzxxy'.lstrip('xyy'))
zxxy
xyxxyyzxxy
xyxzxxy
print("xyyzxyzxzxyy".count('xyy', -10, -1))
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
index()
Both of the above
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('ab'.isalpha())