Exam 9: More About Strings

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which method would you use to determine whether a substring is the suffix of a string?

(Multiple Choice)
4.8/5
(39)

A(n) _______________ is a span of characters that are taken from within a string.

(Short Answer)
4.8/5
(29)

What is the value of the variable string after the execution of the following code? string = 'Hello' String += ' world'

(Multiple Choice)
4.9/5
(24)

If the start index is _____ the end index, the slicing expression will return an empty string.

(Multiple Choice)
4.8/5
(35)

Indexing of a string starts at 1, so the index of the first character is 1, the index of the second character is 2, and so forth.

(True/False)
4.9/5
(34)

Which of the following string methods can be used to determine if a string contains only '\n' characters?

(Multiple Choice)
4.8/5
(41)

If the + operator is used on strings, it produces a string that is the combination of the two strings used as its operands.

(True/False)
4.7/5
(34)

A(n) _______________ exception will occur if you try to use an index that is out of range for a particular string.

(Short Answer)
4.9/5
(40)

Each character in a string has a(n) _______________ which specifies its position in the string.

(Short Answer)
4.8/5
(38)

Strings are _______________, which means that once a string is created, it cannot be changed.

(Short Answer)
4.9/5
(38)

What is the value of the variable string after the execution of the following code? string = 'abcd' String.upper()

(Multiple Choice)
4.8/5
(32)

What is the return value of the string method lstrip()?

(Multiple Choice)
4.7/5
(38)

When the operand on the left side of the * symbol is a string and the operand on the right side is an integer, it becomes the _______________ operator.

(Short Answer)
4.8/5
(33)

The _______________ method returnst if the string contains only numeric digits.

(Short Answer)
4.8/5
(39)

Which list will be referenced by the variable list_strip after the execution of the following code? list_string = '03/07/2008' List_strip = list_string.split('/')

(Multiple Choice)
4.7/5
(33)
Showing 21 - 35 of 35
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)