Python - String Methods - 7

Python - String Methods - 7

12th Grade

10 Qs

quiz-placeholder

Similar activities

2024 Manufacturing Vocabulary

2024 Manufacturing Vocabulary

8th Grade - University

9 Qs

Programming Review

Programming Review

9th - 12th Grade

15 Qs

Mid-Term Review

Mid-Term Review

9th - 12th Grade

15 Qs

JS 1

JS 1

12th Grade

15 Qs

Unit 2 Terms 2.4-2.7

Unit 2 Terms 2.4-2.7

12th Grade

12 Qs

2024 Manufacturing Vocabulary

2024 Manufacturing Vocabulary

8th Grade - University

10 Qs

Raw Materials

Raw Materials

12th Grade

10 Qs

Python - String Methods - 7

Python - String Methods - 7

Assessment

Quiz

Other

12th Grade

Medium

Created by

Amy Austin

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the capitalize() string method in Python do?

Converts the first character of the string to uppercase

Converts the entire string to lowercase

Capitalizes every word in the string

Converts the entire string to uppercase

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is used to check if all characters in a string are alphanumeric?

isnumeric()

isalpha()

isdigit()

isalnum()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the string method isdecimal() return?

True if all characters are decimals

True if the string is a valid identifier

True if all characters are letters

True if all characters are digits

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which string method returns a left justified version of the string?

strip()

rjust()

lstrip()

ljust()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How does the split() method function when no arguments are passed to it?

Splits the string at each letter

Does not split the string

Splits the string at the specified separator

Splits the string at whitespace

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the endswith() string method do?

Checks if the string starts with the specified value

Checks if the string ends with the specified value

Checks if the string contains the specified value

Removes the specified value from the end of the string

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method would you use to convert all characters in a string to lowercase?

lower()

casefold()

upper()

capitalize()

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?