String Data Type(Python)

String Data Type(Python)

12th Grade

20 Qs

quiz-placeholder

Similar activities

quiz_G10

quiz_G10

12th Grade

20 Qs

Quiz1_12&11_2t_20214

Quiz1_12&11_2t_20214

12th Grade

20 Qs

Quiz 01 Keamanan Jaringan

Quiz 01 Keamanan Jaringan

12th Grade

17 Qs

Google

Google

7th - 12th Grade

20 Qs

Lecture Exercise Topic 1.3

Lecture Exercise Topic 1.3

12th Grade

21 Qs

ÔN TẬP CUỐI HKI TIN HỌC 3

ÔN TẬP CUỐI HKI TIN HỌC 3

3rd Grade - University

23 Qs

AV1/R1 2TEC_PM_1 A 11_História e Reconhecimento da UX

AV1/R1 2TEC_PM_1 A 11_História e Reconhecimento da UX

1st Grade - University

15 Qs

4.6.4 Logic Gates

4.6.4 Logic Gates

10th Grade - Professional Development

15 Qs

String Data Type(Python)

String Data Type(Python)

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

Namal (ITNamal)

Used 3+ times

FREE Resource

AI

Enhance your content in a minute

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

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

s = "Python"

print(s[1:4])

a) 'ytho'

b) 'Pyt'

c) 'yth'

d) 'tho'

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

s = "hello"

print(s.capitalize())

a) 'HELLO'

b) 'Hello'

c) 'hELLO'

d) 'hello'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods would you use to convert all characters in a string to lowercase?

a) toLowerCase()

b) lowercase()

c) lower()

d) to_lower()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

s = "Hello, World!"

print(s.split(","))

a) ['Hello', 'World!']

b) ['Hello', ' World!']

c) ['Hello, ', 'World!']

d) ['Hello', 'World']

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you concatenate two strings, 'str1' and 'str2', in Python?

a) str1.concat(str2)

b) str1 + str2

c) str1.append(str2)

d) str1 & str2

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following code?

s = "Python"

print(s[-1])

a) P

b) o

c) n

d) h

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method would you use to remove whitespace from the beginning and end of a string?

a) strip()

b) trim()

c) remove()

d) delete()

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?