String Data Type(Python)

String Data Type(Python)

12th Grade

20 Qs

quiz-placeholder

Similar activities

Excel Quiz

Excel Quiz

KG - University

15 Qs

Data structure test1

Data structure test1

12th Grade

20 Qs

Ôn tập bài 3: Giới thiệu về Microsoft Acces

Ôn tập bài 3: Giới thiệu về Microsoft Acces

12th Grade

15 Qs

Latihan Soal Administrasi Infrastruktur Jaringan XII TKJ

Latihan Soal Administrasi Infrastruktur Jaringan XII TKJ

10th - 12th Grade

20 Qs

PTS KELAS 9

PTS KELAS 9

9th - 12th Grade

20 Qs

User Interface Design - Topic 1

User Interface Design - Topic 1

12th Grade

15 Qs

Tin 12_Trắc nghiệm_Bai2

Tin 12_Trắc nghiệm_Bai2

12th Grade

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()

Access all questions and much more by creating a free account

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?