String manipulation test

A colorful illustration of string manipulation concepts in programming, featuring visual representations of strings being sliced, joined, and transformed, with coding elements and a user interface design.

String Manipulation Mastery Quiz

Test your knowledge on string manipulation with this engaging quiz! Whether you're a beginner or a seasoned coder, this quiz will challenge your understanding of string operations, methods, and indexing.

Key Features:

  • 8 carefully crafted questions
  • Multiple choice, drop-down, and checkbox formats
  • Score your knowledge and identify improvement areas
8 Questions2 MinutesCreated by CodingWizard127
1)What would the following expressions return? "Hello World".upper( ).lower( )
Helloworld
HELLO WORLD
Hello world
Hello world
2)Find the errors. Find the line numbers causing errors. S = "PURA VIDA" S1 = S[: 5] S2 = S[5 :] S3 = S1 * S2 S4 = S2 + '3' S5 = S1 + 3
Line 4 and 6
Line 1 and 4
Line 5 and 6
Line 2and 3
3)Out of the following operators, which ones can be used withstrings? =, -, *, /, //, %, >, <>, in, not in,<=
4)From the string S = "CARPE DIEM", which ranges return "DIE" and "CAR"?
S[6:9] returns DIE S[:3] returns CAR
S[6:9] returns DIE S[1:3] returns CAR
S[5:9] returns DIE S[:4] returns CAR
S[6:8] returns DIE S[:3] returns CAR
5)Strings have both positive and negative indexes.
False
True
6)'ab'.isalpha() will return value as
True
False
7)Which of the following functions will raise an error if the given substring is not found in the string?
Find()
Replace()
Index()
Strip()
Given a string S, write expressions to print first five characters of S (ii) Ninth character of S
Print(S[:4]) print(S[8])
Print(S[:5]) print(S[9])
Print(S[1:5]) print(S[9])
Print(S[:5]) print(S[8])
{"name":"String manipulation test", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Test your knowledge on string manipulation with this engaging quiz! Whether you're a beginner or a seasoned coder, this quiz will challenge your understanding of string operations, methods, and indexing.Key Features:8 carefully crafted questionsMultiple choice, drop-down, and checkbox formatsScore your knowledge and identify improvement areas","img":"https:/images/course1.png"}
Powered by: Quiz Maker