Topic: Chapter 8: Strings and String manipulations (Test 1)



Topic: Chapter 8: Strings and String manipulations
  • «
  • Test: 1(current)
  • «
Q.1
Which of the following is the output of the following python code? str1="TamilNadu" print(str1[::-1])
A. Tamilnadu
B. Tmlau
C. udanlimaT
D. udaNlimaT
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.2
What will be the output of the following code? str1 = "Chennai Schools" str1[7] = "-"
A. Chennai-Schools
B. Chenna-School
C. Type error
D. Chennai
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.3
Which of the following operator is used for concatenation?
A. +
B. &
C. *
D. =
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.4
Defining strings within triple quotes allows creating:
A. Single line Strings
B. Multiline Strings
C. Double line Strings
D. Multiple Strings
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.5
Strings in python:
A. Changeable
B. Mutable
C. Immutable
D. flexible
Answer : Option C
Explaination / Solution:
No Explaination.


Workspace
Report
Q.6
Which of the following is the slicing operator?
A. { }
B. [ ]
C. < >
D. ( )
Answer : Option B
Explaination / Solution:
No Explaination.


Workspace
Report
Q.7
What is stride?
A. index value of slide operation
B. first argument of slice operation
C. second argument of slice operation
D. third argument of slice operation
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report
Q.8
Which of the following formatting character is used to print exponential notation in upper case?
A. %e
B. %E
C. %g
D. %n
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.9
Which of the following is used as placeholders or replacement fields which get replaced along with format( ) function?
A. { }
B. < >
C. ++
D. ^^
Answer : Option A
Explaination / Solution:
No Explaination.


Workspace
Report
Q.10
The subscript of a string may be:
A. Positive
B. Negative
C. Both (a) and (b)
D. Either (a) or (b)
Answer : Option D
Explaination / Solution:
No Explaination.


Workspace
Report


  • «
  • Test: 1(current)
  • «