String Data Type(Python)

String Data Type(Python)

12th Grade

20 Qs

quiz-placeholder

Similar activities

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

Bài kiểm tra số 2

Bài kiểm tra số 2

9th - 12th Grade

20 Qs

python intro

python intro

4th - 12th Grade

17 Qs

quiz dasar python

quiz dasar python

1st Grade - University

20 Qs

Python Review KS3

Python Review KS3

9th - 12th Grade

17 Qs

Python Basics

Python Basics

8th - 12th Grade

23 Qs

Python Quiz 1

Python Quiz 1

1st - 12th Grade

18 Qs

Python Basic II

Python Basic II

11th Grade - University

20 Qs

String Data Type(Python)

String Data Type(Python)

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Namal (ITNamal)

Used 3+ times

FREE Resource

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
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 Computers