Understanding Strings in Python

Understanding Strings in Python

University

10 Qs

quiz-placeholder

Similar activities

Python Spotkanie #1

Python Spotkanie #1

University

7 Qs

MIND ZONE 2.2 [LEVEL 2]

MIND ZONE 2.2 [LEVEL 2]

University

10 Qs

Mastering String Manipulation

Mastering String Manipulation

University

15 Qs

Session 2

Session 2

University

10 Qs

Python Test1 (If Statement)

Python Test1 (If Statement)

University

10 Qs

แบบทดสอบก่อน-หลังเรียนวิชาการเขียนโปรแกรมคอมพิวเตอร์ขั้นสูง

แบบทดสอบก่อน-หลังเรียนวิชาการเขียนโปรแกรมคอมพิวเตอร์ขั้นสูง

University

10 Qs

coding

coding

KG - Professional Development

15 Qs

SISD - Python

SISD - Python

University

10 Qs

Understanding Strings in Python

Understanding Strings in Python

Assessment

Quiz

Computers

University

Medium

Created by

ABISHA D undefined

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a string in Python?

A sequence of characters enclosed in quotes

A list of numbers

A type of variable

A function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

Using single quotes

Using double quotes

Using triple quotes

Using parentheses

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method upper() do?

Converts a string to uppercase

Converts a string to lowercase

Replaces a substring

Finds the length of a string

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print(s.strip()) if s = ' Python '?

'Python'

' Python'

'Python '

' Python '

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method find() return?

The index of the first occurrence of a substring

The last occurrence of a substring

The count of a substring

A boolean value

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the string module in Python?

To provide useful constants and functions for string manipulation

To create graphical user interfaces

To handle file operations

To perform mathematical calculations

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the method isalpha() check?

If the string contains only letters

If the string contains only digits

If the string is empty

If the string contains special characters

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?