Filters
Question type

Study Flashcards

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

A) True
B) False

Correct Answer

verifed

verified

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


A) lpython
B) llo
C) help
D) lop

E) C) and D)
F) None of the above

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

What keywords does Python use for Boolean values?


A) Yes, No
B) On, Off
C) True, False
D) Set, Unset

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

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

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


A) x == y or y
B) y < 5 and y
C) (x > y) and x
D) x > 0 and None

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

Correct Answer

verifed

verified

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;


A) x == 7, y == 11, z == 6
B) x == 6, y == 6, z == 5
C) x = 6, y == 5, z == 6
D) x == 7, y == 12, z == 5

E) None of the above
F) B) and D)

Correct Answer

verifed

verified

Which of the following is true about Python keywords?


A) they can begin with a number, letter, or hyphen
B) they are case sensitive
C) they are written in uppercase
D) they can be a maximum of 6 characters long

E) B) and D)
F) None of the above

Correct Answer

verifed

verified

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


A) [ "George", "John", "Thomas", "James", "Andrew" ]
B) [ "George", "John", "Thomas", "Andrew" ]
C) [ "Andrew", "John", "Thomas", "James" ]
D) [ "Andrew", "George", "John", "Thomas", "James" ]

E) None of the above
F) All of the above

Correct Answer

verifed

verified

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

A) True
B) False

Correct Answer

verifed

verified

Showing 41 - 51 of 51

Related Exams

Show Answer