Python String Slicing

Python String Slicing

University

8 Qs

quiz-placeholder

Similar activities

Refreshing DDP 0

Refreshing DDP 0

University

10 Qs

Python Basics

Python Basics

12th Grade - University

10 Qs

X-Quiz #5

X-Quiz #5

University

10 Qs

Python quiz

Python quiz

10th Grade - Professional Development

10 Qs

PSP Week3

PSP Week3

University

10 Qs

Python - Year 8

Python - Year 8

3rd Grade - University

10 Qs

Weekly Contest #6 - TechXNinjas

Weekly Contest #6 - TechXNinjas

University

10 Qs

Advance Python

Advance Python

KG - Professional Development

10 Qs

Python String Slicing

Python String Slicing

Assessment

Quiz

Computers

University

Medium

Created by

Sarju S

Used 43+ times

FREE Resource

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of above Python code?

str1="6/4"

print("str1")

1

6/4

1.5

str1

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following will result in an error?

print(str1[2])

str1[1]="x"

print(str1[0:9])

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of below Python code?

str1="Information"

print(str1[2:8])

format

formatio

orma

ormat

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the code given below?

# Code snippet starts

org = ‘QuizOrbit’

print(org[-1:-6:-1])

# Code snippet ends

tibrO

Orbit

Quiz

QuizOrbit

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Find the output of the code given below?

# Code snippet starts

org = ‘QuizOrbit’

 print(org[::-1])

 # Code snippet ends

tibrOziuQ

QuizOrbit

OrbitQuiz

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of below code:

s=’cppbuzz chicago’

print(s[3:5])

buzzc

pbuzz

bu

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A string is an _______ data type.

Mutable

Immutable

8.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the index of the last character in a string?

0

-1

1