Understanding Strings in Python

Understanding Strings in Python

University

82 Qs

quiz-placeholder

Similar activities

Adv Algebra 2 Fall Final Review

Adv Algebra 2 Fall Final Review

10th Grade - University

80 Qs

G3C-MMW MIDT3RM 3X4MIN4TION

G3C-MMW MIDT3RM 3X4MIN4TION

University

80 Qs

ACT Prep Questions

ACT Prep Questions

KG - University

80 Qs

Math Review for final

Math Review for final

6th Grade - University

85 Qs

6th Grade Math Review Florida BEST standards FAST test

6th Grade Math Review Florida BEST standards FAST test

6th Grade - University

79 Qs

School Final

School Final

7th Grade - University

80 Qs

ACG3173 Exam 2 Practice

ACG3173 Exam 2 Practice

University

80 Qs

Exam Beed

Exam Beed

University

80 Qs

Understanding Strings in Python

Understanding Strings in Python

Assessment

Quiz

Mathematics

University

Practice Problem

Medium

Created by

Van Khanh

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

82 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid string declaration?

string = "Hello"

string = 'Hello'

string = """Hello"""

All of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you get the length of a string s?

len(s)

length(s)

s.length()

size(s)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method converts all characters of a string to uppercase?

toUpper()

upper()

to_upper()

upcase()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of "hello".capitalize()?

HELLO

hello

Hello

Hello World

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to concatenate strings in Python?

+

&

concat()

append()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does s[::-1] do?

Reverses the string s

Returns the first character of s

Returns the last character of s

Rotates the string s

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you check if a string s contains only digits?

s.isdigit()

s.isnumeric()

s.isalpha()

s.isalnum()

Create a free account and access millions of resources

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?