Search Header Logo

String Formatting in Python

Authored by Dima Alkhassawneh

Computers

9th Grade

Used 16+ times

String Formatting in Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an example of string concatenation?

  • a) "Hello" * 3

  • b) "Hello" + "World"

  • c) "Hello".find("e")

  • d) "Hello".split()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. What is the output of the following code?

print("Hello".replace("e", "a"))

Hallo

Hello

Hella

Hillo

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of this expression?

10 // 3

3

3.33

4

none

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to find the index of a substring within a string?

  • string.replace()

string.index()

string.find()

string.split()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the expression 2 ** 3 return in Python?

8

6

9

none

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which arithmetic operator is used for modulus (remainder) in Python?

%

/

//

**

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

find the output:
print("Hello Sara".find("World"))

4

1

-1

none

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?