Exam 8: More About Strings

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

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

(Multiple Choice)
4.9/5
(77)

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

(Short Answer)
4.8/5
(82)

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

(Multiple Choice)
4.7/5
(94)

The _______________ method returns true if the string contains only numeric digits.

(Short Answer)
4.9/5
(88)

When accessing each character in a string, such as for copying purposes, you would typically use a while loop.

(True/False)
4.9/5
(79)

What is the first negative index in a string?

(Multiple Choice)
4.9/5
(68)

What will be assigned to the string variable pattern after the execution of the following code? I = 3 Pattern = 'z' * (5*i)

(Multiple Choice)
4.8/5
(95)

The _______________ operator can be used to determine whether one string is contained in another string.

(Short Answer)
4.8/5
(87)

An expression of the form string[i] = 'i' is a valid expression.

(True/False)
4.8/5
(81)

The third number in string slicing brackets represents the _______________ value.

(Short Answer)
4.8/5
(73)

Invalid indexes do not cause slicing expressions to raise an exception.

(True/False)
4.7/5
(82)

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

(Multiple Choice)
4.8/5
(89)

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

(Multiple Choice)
4.9/5
(77)

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

(Short Answer)
4.9/5
(82)

What will be assigned to s_string after the execution of the following code? Special = '1357 Country Ln.' S_string = special[-3: ]

(Multiple Choice)
4.9/5
(90)
Showing 21 - 35 of 35
close modal

Filters

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