Exam 1: Basic Python Programming

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

A list mutator is a method used to modify the contents of a list.

Free
(True/False)
5.0/5
(37)
Correct Answer:
Verified

True

The keyword while means the same thing as While in Python.

Free
(True/False)
4.8/5
(40)
Correct Answer:
Verified

False

The keywords True and False are floating point values.

Free
(True/False)
4.8/5
(47)
Correct Answer:
Verified

False

In Python, a variable containing the value 5 will evaluate as true if used with the and logical operator.

(True/False)
4.9/5
(32)

The main python module contains the starting point of execution.

(True/False)
4.9/5
(38)

What symbol is used to insert a tab in a string?

(Multiple Choice)
4.9/5
(38)

Which statement is true about Python syntax?

(Multiple Choice)
4.9/5
(35)

Strings are mutable objects, which means you can replace their contents.

(True/False)
4.8/5
(38)

What keyword is used to make a multiway if statement?

(Multiple Choice)
4.9/5
(43)

Strings are compared using ASCII ordering.

(True/False)
4.9/5
(33)

Select the answer that should be used to replace the missing code in the following statements. myList = list() FileObj = open("myfile.dat", "rb") While True: Try: Item = pickle.load(fileObj) MyList.append(item) < missing code > FileObj.close() Break Print(myList)

(Multiple Choice)
4.9/5
(42)

To create an end-of-line comment, which symbol do you use to begin the comment?

(Multiple Choice)
4.8/5
(34)

It is good practice to import all names from a module using the * operator.

(True/False)
4.8/5
(37)

With what character does the print function terminate its output by default?

(Multiple Choice)
4.7/5
(42)

What is the output of the following code? Sum = 0 For value in range(1,4): If value == 2: Sum = sum**2 Sum += value Print(sum)

(Multiple Choice)
4.9/5
(40)

In Python, _MyVar15 is a valid variable name.

(True/False)
4.7/5
(34)

The expression primes = (2, 3, 5, 7, 11) creates a list named primes.

(True/False)
4.9/5
(40)

Indenting code that should be executed when an if statement evaluates as true makes your program easier to read, but the indentation is not necessary.

(True/False)
4.9/5
(39)

In a class definition, what type of method uses the values of the object's instance variables without changing them?

(Multiple Choice)
4.9/5
(39)

Standard functions and Python's library functions check the types of their arguments when the function is called.

(True/False)
4.8/5
(33)
Showing 1 - 20 of 51
close modal

Filters

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