delete all the trailing whitespace characters
delete all the leading whitespace characters
delete all the leading and trailing whitespace characters
delete upper case characters
What will be the output of the following Python code?
print('a B'.isalpha())
True
False
None
Error
print('xyxxyyzxxy'.lstrip('xyy'))
zxxy
xyxxyyzxxy
xyxzxxy
none of the mentioned
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
error
>>>max("what are you")
what
y
a
What will be the output of the following Python code snippet?
print('11'.isnumeric())
List
Tuple
Dictionary
What does the following code print ?
x = 'mohan'for i in range (len(x)): x[i].upper()print (x)
mohan
MOHAN
None of These
print('abcdef12'.replace('cd', '12'))
ab12ef12
abcdef12
ab12efcd
print('1.1'.isnumeric())
space
colon
semi colon
find()
copy()
upper()
capitalize()
print("xyyzxyzxzxyy".count('yy', 1))
2
0
1
slicer
Slicing
Membership
None of these-
print('ab,12'.isalnum())
str1[ : : -1 ]
str1[ : : 1 ]
str1[ : -1 : -1 ]
x = 'abcd'for i in range(len(x)): x[i].upper()print (x)
abcd
ABCD
What will be the output of following statement ?
>>>"m"+"n1"
'm+nl'
'mn1'
'm n1'
'm'
example = "snow world"example[3] = 's'print (example)
snow
snow world
snos world
what will the output of following code
my_string="Hello,world"print(my_string[-6:-1])
,worl
worl
world
oworld
print("abcdef".find("cd") == "cd" in "abcdef")
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
print(max("what are you"))
u
t
count()
strip()
उपरोकà¥à¤¤ सà¤à¥€
print('Hello World'.istitle())
print('abcdefcdghcd'.split('cd', 0))
[‘abcdefcdghcd’]
‘abcdefcdghcd’
dlroWolleH
Hello Worl
d
wd[4:]
wd[:4]
wd[-5:]
wd[:-4]
index()
Both of the above
None of the above
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
print('HelloWorld'.istitle())
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('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.
19
18
17
What is the output of the following program:
print ("Hello World"[::-1])
dlroW olleH
D
print('cd'.partition('cd'))
(‘cd’)
(”)
(‘cd’, ”, ”)
(”, ‘cd’, ”)
print("xyyzxyzxzxyy".endswith("xyy", 0, 2))
x = 'abcd'for i in x: print(i) x.upper()
a B C D
a b c d
A B C D
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
print('abcdefcdghcd'.split('cd', 2))
[‘ab’, ‘ef’, ‘ghcd’]
[‘ab’, ‘efcdghcd’]
[‘abcdef’, ‘ghcd’]
23
'2+3'
'23'
print('ab'.isalpha())
print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
xyyxyyxyxyxxy
12y12y1212x12
example = "helle"print(example.find("e"))
-1
print("Welcome to Python".split())
[“Welcome”, “to”, “Python”]
(“Welcome”, “to”, “Python”)
{“Welcome”, “to”, “Python”}
“Welcome”, “to”, “Python”
print('abcdefcdghcd'.split('cd'))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
print('xyyzxxyxyy'.lstrip('xyy'))
zxxyxyy
z
anywhere in between the file
End
beginning
second line of the file
string = "my name is x"for i in string: print (i, end=", ")