Exam 1: Basic Python Programming

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

What are the values of variables x, y, and z after the following code is run? Y = 0 Z = 0 For x in range(5,7): If y > z: Z, y = y, z Y = y + x;

(Multiple Choice)
4.8/5
(43)

A literal representation of a list is made using parentheses to enclose items separated by commas.

(True/False)
4.9/5
(36)

What is the value of string1 after the following statement is executed? String1 = "hello"[ :3 ] + "python"[ 0 ]

(Multiple Choice)
4.9/5
(31)

Use the comparison operator != to check if one value is not equal to another value.

(True/False)
4.9/5
(38)

What is the value of newList after the following code is executed? NewList = [ "George", "John", "Thomas", "James" ] NewList.pop() NewList.append("Andrew")

(Multiple Choice)
4.8/5
(29)

What keywords does Python use for Boolean values?

(Multiple Choice)
4.8/5
(47)

To make your program more secure, use obscure variable names such as xz14dEEa .

(True/False)
4.7/5
(36)

A docstring is another term for a Python variable that holds a string constant.

(True/False)
4.8/5
(48)

Assume x is equal to 5 and y is equal to 0. Which comparison operation returns True?

(Multiple Choice)
4.7/5
(35)

The print function outputs a newline by default before its arguments are printed.

(True/False)
4.8/5
(33)

Which of the following is true about Python keywords?

(Multiple Choice)
4.8/5
(35)
Showing 41 - 51 of 51
close modal

Filters

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