No student devices needed. Know more
20 questions
One of the following functions is not used with Python String
Split
Remove
Replace
Choose the correct syntax of the split function:
x.split[]
split(x)
x.split(",", 3)
X.SPLIT(",", 3)
Choose the correct syntax of the replace function:
x.Replace(x)
x.replace(y)
x.replace(3,x)
x.replace("j","3")
Choose the correct code to print line of 10 stars using repetition operation:
print("**********")
print("*"*10)
print("*"^10)
print("*"+10)
The correct syntax of the len function for string x:
x.len()
len[x]
LEN[]
len(x)
The correct syntax for converting the string x to uppercase is :
X.upper()
upper(x)
x.UPPER[ ]
x.upper()
The correct syntax for converting the string myname to lowercase is :
myNAME.lower[ ]
myname.lower( )
myname.upper( )
myname_lower(12 )
To remove the spaces present at start and end of the string, you can use
split()
len()
strip()
remove()
Let x= "Python", the output of print(x.upper()) is
python
PYTHON
_PYTHON
"PYTHON"
Let x= "java", the output of Print(x.replace("j","L") ) is
LAVA
Error
lava
Lava
Let x= "python is a high level language", the output of print(x[5].replace("n","*")) is
pytho* is a high level language
python is a high level language
*
Error
Let x= "python is a high level language", the output of print(len(x[-1])) is
1
31
Error
25
Let x= "Python is a high level language", the output of print(x.replace(x[-3],"3")) is
Error
Python is 3 high level l3ngu3ge
Python is a high l3v3l languag3
Python is a high level language
Let x= "Python is a high level language", the output of print(x[7].upper()) is
Python is a high level language
PYTHON IS A HIGH LEVEL LANGUAGE
I
S
Let x= "Python is a high level language", the output of print(x[2].upper()+x[3].lower()+x[-1]) is
THE
The
ThE
the
Let x= "Python is a high level language", the output of print(x[-4].upper()+x[8]+x[-1]) is
Use
Age
USE
Error
Choose the correct python program that has the output 6
print(len("Python"))
Print(len("Python"))
x= "Python"
print(x.replace("Python","6"))
Both a and c
Let x= "Python is a high level language", the output of
print(x.split("i", 2))
['Pyth', 'n is a high level language']
['Python is ', ' high level l', 'nguage']
['Python ', 's a h', 'gh level language']
Error
Let x= "Python", the output of
print(x[0])
print(x[1])
print(x[2])
PYT
P
y
t
T
h
o
n
oh
Let x= "Python", the output of
print(x[0])
print(x[-1])
print(x[-2])
P
N
O
p
O
n
t
h
y
P
n
o
Explore all questions with a free account