Search Header Logo

Python :: String review

Authored by ALBERTO HILARIO

Computers

University

Used 16+ times

Python :: String review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following adds a line comment in Python?

// comment here

# comment here

"" comment here

/* comment here */

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following concatenates strings in Python?

'hello' & 'world'

'hello' -> 'world'

'hello' += 'world'

'hello' + 'world'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following will produce "ppp"?

'p' *= 3

'p' = 'p'*3

'p' * 3

'p' x 3

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print('python'[0:2])?

py

yt

pyt

on

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print('python'[1:4])?

pyth

yth

ytho

pyt

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print('HELLO WORLD'.lower())?

hello world

Hello world

HELLO WORLD

Hello World

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How would you capitalize 'hello world'?

'hello world'.uppercase()

'hello world'.upper()

'hello world'.toUpper()

'hello world'.go_upper()

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?