Python Strings and Basic Operations

Python Strings and Basic Operations

Assessment

Flashcard

Computers

University

Hard

Created by

Mrs. 1

FREE Resource

Student preview

quiz-placeholder

8 questions

Show all answers

1.

FLASHCARD QUESTION

Front

What is the syntax to create a single-line string in Python?

Back

s1 = 'I B.Tech' or s2 = 'Robotics'.

2.

FLASHCARD QUESTION

Front

How do you create a multi-line string in Python?

Back

s3 = """This is a multi-line string""".

3.

FLASHCARD QUESTION

Front

What function is used to get the length of a string in Python?

Back

len() function.

4.

FLASHCARD QUESTION

Front

What is the output of print(len(text)) if text = 'Python'?

Back

6.

5.

FLASHCARD QUESTION

Front

What does print(text[0]) return if text = 'Python'?

Back

'P'.

6.

FLASHCARD QUESTION

Front

What does print(text[-1]) return if text = 'Python'?

Back

'n'.

7.

FLASHCARD QUESTION

Front

What does print(text[0:4]) return if text = 'Python'?

Back

'Pyth'.

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?

Discover more resources for Computers