H - Substrings

H - Substrings

12th Grade

45 Qs

quiz-placeholder

Similar activities

2024_UAS XII RPL 1 PBO

2024_UAS XII RPL 1 PBO

12th Grade

40 Qs

Python Coding Language

Python Coding Language

8th - 12th Grade

40 Qs

Java Assesment Unit 1, Unit2

Java Assesment Unit 1, Unit2

9th - 12th Grade

44 Qs

Python Coding Specialist Exam

Python Coding Specialist Exam

9th - 12th Grade

46 Qs

python set 3

python set 3

9th - 12th Grade

41 Qs

Quizes-Syntax-Master

Quizes-Syntax-Master

12th Grade

45 Qs

Class XI Revision I

Class XI Revision I

11th - 12th Grade

43 Qs

Week 6 - Input/Output Functions

Week 6 - Input/Output Functions

9th - 12th Grade

46 Qs

H - Substrings

H - Substrings

Assessment

Quiz

Computers

12th Grade

Hard

Created by

S Johnston

Used 1+ times

FREE Resource

45 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A substring is:

a sequence of characters within a string

a type of variable

an entire string repeated twice

a function that sorts strings

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Select the correct output of the following code:

mystring = "Hello world"

sub1 = mystring[0:2]

He

Hel

Hello

llo

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Select the correct output of the following code:

mystring = "Hello world"

sub2 = mystring[4:6]

o

o w

w

wo

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does mystring[-1] return if mystring = "Hello world"?

d

H

o

"

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does mystring[:5] return if mystring = "Hello world"?

Hello

Hello

Hello w

world

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which slice would return just the first letter of a string called "text"?

text[0]

text[1]

text[-1]

text[0:2]

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following would return the last three characters of a string?

string[-3:]

string[:3]

string[3:]

string[-1:3]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?