String Data Type(Python)

String Data Type(Python)

12th Grade

20 Qs

quiz-placeholder

Similar activities

LETS PLAY QUIZ - PYTHON CBSE CLASS XII

LETS PLAY QUIZ - PYTHON CBSE CLASS XII

11th - 12th Grade

20 Qs

python quiz

python quiz

12th Grade

20 Qs

ASK F2 -KOD ARAHAN (PYTHON)

ASK F2 -KOD ARAHAN (PYTHON)

1st Grade - University

15 Qs

Bài kiểm tra giữa kì 2

Bài kiểm tra giữa kì 2

9th - 12th Grade

20 Qs

Python Basics

Python Basics

KG - University

16 Qs

python intro

python intro

4th - 12th Grade

17 Qs

Python Recap

Python Recap

7th Grade - University

20 Qs

Python variables

Python variables

9th - 12th Grade

16 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?