Python String Slicing

Quiz
•
Computers
•
University
•
Medium
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
Similar Resources on Wayground
10 questions
C Program Array and strings

Quiz
•
University
10 questions
Python quick quiz

Quiz
•
University
10 questions
Python Basics

Quiz
•
12th Grade - University
10 questions
Python Dictionaries

Quiz
•
University
10 questions
Weekly Contest #6 - TechXNinjas

Quiz
•
University
10 questions
Python Control Statements

Quiz
•
University
10 questions
CIS1101-programming practice2

Quiz
•
University
10 questions
csharp

Quiz
•
University
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade