Ch 2, Ch 3

Ace your homework & exams now with Quizwiz!

In Python the ________ symbol is used as the not-equal-to operator.

!=

Which mathematical operator is used to raise 5 to the second power in Python?

**

What will be displayed after the following code is executed? def pass_it(x, y): z = x*y result = get_result(z) return(result) def get_result(number): z = number + 2 return(z) num1 = 3 num2 = 4 answer = pass_it(num1, num2) print(answer)

14

What is the output of the following command, given that value1 = 2.0 and value2 = 12? print(value1 * value2)

24.0

What will be the output after the following code is executed? def pass_it(x, y): z = x , ", " , y num1 = 4 num2 = 8 answer = pass_it(num1, num2) print(answer)

4, 8 8, 4 48 None <----

In Python the ________ symbol is used as the equality operator.

==

Multiple Boolean expressions can be combined by using a logical operator to create ________ expressions.

Compound

A(n) ________ is a diagram that graphically depicts the steps that take place in a program?

Flowchart

What is the output of the following print statement? print 'I\'m ready to begin'

I'm ready to begin

Which of the following will determine if the turtle's pen is up and will change it to down if that is the case?

If not(turtle.isdown()): Turtle.pendown()

What is the output of the following print statement? print('The path is D:\\sample\\test.')

The path is D:\sample\test.

A Boolean variable can reference one of two values which are

True or False

The line continuation character is

\

What symbol is used to mark the beginning and end of a string?

a quote mark (")

When using the ________ logical operator, both subexpressions must be true for the compound expression to be true.

and

The Python turtle is initially positioned in the ________ of a graphics window and it first appears, by default, to be heading ________.

center, east

A(n) ________ structure is a logical design that controls the order in which a set of statements execute.

control

The decision structure that has two possible paths of execution is known as

dual alternative

In a print statement, you can set the ________ argument to a space or empty string to stop the output from advancing to a new line.

end end=' '

After the execution of the following statement, the variable sold will reference the numeric literal value as (n) ________ data type. sold = 256.752

float

Which of the following is the correct if clause to determine whether choice is anything other than 10? if not(choice < 10 and choice > 10): if choice != 10 if choice != 10: if choice <> 10:

if choice != 10:

Which of the following is the correct if clause to determine whether choice is anything other than 10? if not(choice < 10 and choice > 10): if choice != 10: if choice <> 10: if choice != 10

if choice != 10:

Which of the following is the correct if clause to determine whether y is in the range 10 through 50, inclusive? if y >= 10 and y <= 50: if 10 > y and y < 50: if 10 < y or y > 50: if y >= 10 or y <= 50:

if y >= 10 and y <= 50:

Which of the following statements causes the interpreter to load the contents of the random module into memory?

import random

To use Python's turtle graphics, you must include which of the following statements in your program?

import turtle

The ________ built-in function is used to read a number that has been typed on the keyboard.

input()

A ________ variable is created inside a function. named constant

local

Which logical operators perform short-circuit evaluation?

or, and

A(n) ________ is a variable that receives an argument that is passed into a function.

parameter

Which of the following will display 20%? print(format(20, '.0%')) print(format(0.2 * 100, '.0%')) print(format(0.2, '.0%')) print(format(0.2, '%'))

print(format(0.2, '.0%')) <enter>

What is the informal language, used by programmers use to create models of programs, that has no syntax rules and is not meant to be compiled or executed?

pseudocode

Which of the following will hide the turtle if it is visible?

turtle.hideturtle()


Related study sets

Chapter 15: Qualitative Data Analysis

View Set

weeks 1-3 (ch 1, 2, 3, 21, 18, 19, 20, 12, 13, & 14)

View Set

Keogh (HR-10) Plans (20.2-20.2.2)

View Set

Corporal's Course (Leadership II)

View Set

Кримінальний кодекс

View Set

ME-253 Intro to Manufacturing Lab

View Set