python strings

python strings

Professional Development

15 Qs

quiz-placeholder

Similar activities

list and dictionary

list and dictionary

Professional Development

17 Qs

PJP Apr 23

PJP Apr 23

Professional Development

10 Qs

Python Code

Python Code

8th Grade - Professional Development

20 Qs

pemrograman dasar

pemrograman dasar

Professional Development

10 Qs

JS Quiz

JS Quiz

Professional Development

14 Qs

BSAIT 1-2 QUIZ

BSAIT 1-2 QUIZ

Professional Development

20 Qs

String and List

String and List

Professional Development

14 Qs

Python Test 5A

Python Test 5A

Professional Development

10 Qs

python strings

python strings

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Assoc.Prof,IT Chennai

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the following Python code snippet do?

string = "Hello, World!"

print(string.upper())

Prints “Hello, World!” in lowercase

Converts “Hello, World!” to uppercase and prints it

Reverses the string “Hello, World!”

Removes all whitespace characters from the string “Hello, World!”

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How can you concatenate two strings in Python?

Using the concat() method

Using the join() method

Using the & operator

Using the + operator

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following Python code snippet?

string = "Hello, World!"

print(string[3:7])

“Hello”

“lo, “

“lo, W”

“lo, World”

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which method is used to split a string into a list of substrings based on a delimiter in Python?

split()

substring()

separate()

divide()

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the strip() method do in Python string manipulation?

Removes all whitespace characters from both ends of the string

Removes all characters except alphabets from the string

Converts the string to uppercase

Converts the string to lowercase

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following Python code snippet?

string = "Hello, World!"

print(string.rjust(20))

” Hello, World!”

“Hello, World! “

” Hello, World! “

“Hello, World! “

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What does the isdigit() method do in Python string manipulation?

Checks if all characters in the string are digits

Converts the string to lowercase

Checks if all characters in the string are alphabets

Checks if the string is empty

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?