Exam 8: More About Strings

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

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

(Short Answer)
4.8/5
(77)

You cannot use a for loop to iterate over the characters in a string.

(True/False)
4.8/5
(87)

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

(Short Answer)
4.8/5
(84)

What list will be referenced by the variable list_strip after the following code executes? My_string = '03/07/2018' List_strip = my_string.split('/')

(Multiple Choice)
4.9/5
(82)

The index -1 identifies the last character of a string.

(True/False)
4.9/5
(84)

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

(Multiple Choice)
4.9/5
(76)

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

(True/False)
4.8/5
(87)

If a whole paragraph is included in a single string,the split()method can be used to obtain a list of the sentences in the paragraph.

(True/False)
4.7/5
(79)

In slicing,if the end index specifies a position beyond the end of the string,Python will use the length of the string instead.

(True/False)
4.7/5
(79)

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

(Multiple Choice)
5.0/5
(92)

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

(Multiple Choice)
4.8/5
(78)

Which method would you use to determine whether a certain substring is present in a string?

(Multiple Choice)
4.8/5
(85)

What will be assigned to the variable some_nums after the following code executes? Special = '0123456789' Some_nums = special[0:10:2]

(Multiple Choice)
4.8/5
(76)

The following code will display 'yes + no': mystr = 'yes' yourstr = 'no' mystr += yourstr print(mystr)

(True/False)
4.9/5
(87)

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

(Short Answer)
4.9/5
(67)

What will be assigned to the variable s_string after the following code executes? Special = '1357 Country Ln.' S_string = special[4:]

(Multiple Choice)
4.8/5
(82)

The following expression is valid: string[i] = 'i'

(True/False)
4.9/5
(73)
Showing 21 - 37 of 37
close modal

Filters

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