Understanding Strings in Python

Understanding Strings in Python

University

82 Qs

quiz-placeholder

Similar activities

Midterm Exam in MM 2210

Midterm Exam in MM 2210

University

82 Qs

Ashley mathematics q.e

Ashley mathematics q.e

12th Grade - University

86 Qs

untitled

untitled

6th Grade - University

85 Qs

Python Conditional Execution and Functions

Python Conditional Execution and Functions

University

81 Qs

Python Lists and Dictionaries Quiz

Python Lists and Dictionaries Quiz

University

82 Qs

Top Notch 2 - Review U1-3

Top Notch 2 - Review U1-3

KG - University

77 Qs

MMW - Chapter 2

MMW - Chapter 2

University

86 Qs

Geometry Spring Term Benchmark Review: CoordinateGeo/Trig/Circle

Geometry Spring Term Benchmark Review: CoordinateGeo/Trig/Circle

10th Grade - University

82 Qs

Understanding Strings in Python

Understanding Strings in Python

Assessment

Quiz

Mathematics

University

Medium

Created by

Van Khanh

Used 1+ times

FREE Resource

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
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?

Discover more resources for Mathematics