String Function Application in Python Quiz

String Function Application in Python Quiz

10th Grade

10 Qs

quiz-placeholder

Similar activities

Python-Basic

Python-Basic

3rd Grade - University

15 Qs

Python Variables

Python Variables

7th - 12th Grade

10 Qs

Java Strings

Java Strings

9th - 12th Grade

12 Qs

Python String Data Structure

Python String Data Structure

10th - 12th Grade

12 Qs

Python String Functions

Python String Functions

10th - 12th Grade

12 Qs

Unit 1 Post Test: Basic Python

Unit 1 Post Test: Basic Python

9th - 12th Grade

10 Qs

Unit 8 CodeHS Computer Science Essentials

Unit 8 CodeHS Computer Science Essentials

10th - 12th Grade

12 Qs

String Quiz

String Quiz

9th - 12th Grade

15 Qs

String Function Application in Python Quiz

String Function Application in Python Quiz

Assessment

Quiz

Computers

10th Grade

Medium

Created by

hemlata singhal

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following is the correct way to extract the first three characters from a string in Python?

str[:3]

str[0:2]

str[1:3]

str[0:3]

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Python, which function is used to find the length of a string?

len()

length()

size()

count()

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code snippet? str1 = "Hello" str2 = "World" result = str1 + str2 print(result)

HelloWorld

Hello World

HelloWorld

Hello, World

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? str1 = "Python" print(str1.upper())

python

PYTHON

PyThOn

PythOn

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to find the index of the first occurrence of a substring in a string in Python?

find()

index()

search()

locate()

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? str1 = "Python Programming" print(str1[7:])

Programming

Python

Program

ming

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following code? str1 = "Hello, World!" print(str1.replace("Hello", "Hi"))

Hi, World!

Hello, Hi!

Hi, Hi!

Hello, World!

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?