Online Test - Strings

Description

Quiz on Online Test - Strings, created by Aparna Dhirde on 15/03/2020.
Aparna Dhirde
Quiz by Aparna Dhirde, updated more than 1 year ago
Aparna Dhirde
Created by Aparna Dhirde over 5 years ago
138
0
1 2 3 4 5 (0)

Resource summary

Question 1

Question
A string is a sequence of characters enclosed in ………
Answer
  • single quote
  • double quote
  • triple quote
  • all of the above

Question 2

Question
What will be the output of the following Python statement? >>>”a”+“bc”
Answer
  • a
  • bc
  • bca
  • abc

Question 3

Question
What arithmetic operators cannot be used with strings?
Answer
  • +
  • *
  • -
  • All of the mentioned

Question 4

Question
The format function, when applied on a string returns ___________
Answer
  • Error
  • int
  • bool
  • str

Question 5

Question
Python does not have a character data type.
Answer
  • True
  • False

Question 6

Question
Strings in Python are mutable
Answer
  • True
  • False

Question 7

Question
Retrieving a portion of a string is called slicing
Answer
  • True
  • False

Question 8

Question
Indexing is used for accessing individual characters within a string.
Answer
  • True
  • False

Question 9

Question
Each character of a string can be accessed either using a for loop or while loop.
Answer
  • True
  • False

Question 10

Question
What will be the output of the following Python statement? >>>”abcd”[2:]
Answer
  • a
  • ab
  • cd
  • dc
Show full summary Hide full summary

0 comments

There are no comments, be the first and leave one below:

Similar

Chemistry General Quiz
lauren_johncock
Geography - Unit 1A
NicoleCMB
OCR AS Biology - Enzymes
Chris Osmundse
Was the Weimar Republic doomed from the start?
Louisa Wania
World at Risk: Disaster hotspots - the Philippines
Holly Lovering
AQA GCSE Physics Unit 2.6
Matthew T
Circle Theorems
I Turner
Advantages and Disadvantages of Parliamentary Law making
Sinead Gapp
Bay of Pigs Invasion : April 1961
Alina A
Leaving Cert Poetry 2017
Mark O'M