Filters
Question type

Study Flashcards

What happens if you attempt to access a string using an index equal to the string's length?


A) The entirety of the string will be accessed.
B) The name of the string will be accessed.
C) The string's location in memory will be returned.
D) An error will occur, indicating the index is out of range.

E) C) and D)
F) B) and C)

Correct Answer

verifed

verified

The string is a mutable data structure.

A) True
B) False

Correct Answer

verifed

verified

What statement regarding the structure of strings is accurate?


A) A string is a sequence of zero or more characters.
B) A string's length as calculated by the len() function is always "1".
C) A string cannot be decomposed into more primitive parts.
D) A string is a mutable data structure.

E) B) and D)
F) A) and B)

Correct Answer

verifed

verified

A Caesar cipher uses a plaintext character to compute two or more encrypted characters, and each encrypted character is computed using two or more plaintext characters.

A) True
B) False

Correct Answer

verifed

verified

Which of the following are examples of protocols that utilize encryption for data transfer? (Choose two.)


A) HTTP
B) HTTPS
C) FTPS
D) RCP

E) A) and C)
F) All of the above

Correct Answer

verifed

verified

The exists file system function is included in the os.path module.

A) True
B) False

Correct Answer

verifed

verified

Using a text editor such as Notepad or TextEdit, you can create, view, and save data in a text file.

A) True
B) False

Correct Answer

verifed

verified

You are attempting to open a file containing a list of integer numbers, each on a separate line, and read them into Python as int types. What statement could you use to do this, assuming each line is represented by the line variable in a continuous loop?


A) num = int(line.strip() )
B) num = line.strip()
C) num = line.strip(int(line) )
D) num = line[:-1]

E) A) and B)
F) A) and C)

Correct Answer

verifed

verified

What two methods can be used to return a copy of a string named s converted to all lowercase and all uppercase respectively?


A) s.lower()
B) s.lowcase()
C) s.upper()
D) s.upcase()

E) A) and C)
F) A) and B)

Correct Answer

verifed

verified

A difference between functions and methods is that methods cannot return values.

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 50 of 50

Related Exams

Show Answer