wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

XII - CS - Lesson 8 - Strings and String Manipulation

Total questions: 25

Worksheet time: 18mins

Name
Class
Date
1.

String is (a)   in python

2.

(a)   handle array of characters

3.

(a)   is a sequence of Unicode characters that may be a combination of letters, numbers, or special symbols enclosed within single, double or even triple quotes.

4.

Which can't be used to represent strings?

a)

' '

b)

" "

c)

''' '''

d)

{ }

5.

(a)   once defined, it cannot be changed during execution.

6.

(a)   are immutable

7.

To include string with single quote, ______ should be used to represent string.

a)

' '

b)

" "

c)

( )

d)

{ }

8.

________ is used to represent multi line strings.

a)

' '

b)

" "

c)

''' '''

d)

{ }

9.

What is used to access and manipulate the strings?

a)

Index values

b)

Subscript

c)

Either a or b

d)

Neither a or b

10.

The subscript can be _________ numbers

a)

Positive

b)

Negative

c)

Either a or b

d)

Neither a or b

11.

The positive subscript ______ is assigned to the first character.

a)

1

b)

o

c)

0

d)

-1

12.

___ index values is used assign to the last character in a string in forward indexing. if n is size of string.

a)

n

b)

-n

c)

n-1

d)

n+1

13.

The negative index assigned from the last character to the first character in reverse order begins with _____

a)

1

b)

0

c)

-1

d)

-n

14.

(a)   () function changes all occurrences of a particular character in a string.

15.

Joining of two or more strings is called as

a)

Concatenation

b)

Replicating

c)

Appending

d)

Assigning

16.

Which operator is used for string concatenation?

(a)  

17.

Adding more strings at the end of an existing string is known _______

a)

Concatenation

b)

Replicating

c)

Append

d)

Assigning

18.

Which operator add more strings at the end of an existing string ?

(a)  

19.

The (a)   oprerator is used to display a string in multiple number of times.

20.

(a)   is a substring of a main string

21.

A substring can be taken from the original string by using ___________

a)

Index values

b)

[ ]

c)

Both a and b

d)

Either a or b

22.

Using ______ operator, you have to slice one or more substrings from a main string

a)

Slice

b)

Stride

c)

Repeatng

d)

Join

23.

Identify the slice operator?

a)

[ ]

b)

{ }

c)

( )

d)

< >

24.

_______ refers to the number of characters to move forward after the first character is retrieved from the string

a)

Start

b)

End

c)

Stride

d)

[ ]

25.

Default value of stride is (a)