Programming In Python – WGU D335: Questions
With Applicable Solutions
Program Correct Answer - Consists of instructions executed
one at a time
Input Correct Answer - A program gets data, perhaps from a
file, keyboard, touchscreen, network.
Process Correct Answer - A program performs computations
on that data, such as adding two values like x + y
Output Correct Answer - A program puts that data
somewhere , such as to a file, screen, or network
Variables Correct Answer - Refer to data , like x, y, and z.
Triangle's area Correct Answer - 1/2(base)(height)
Computational thinking Correct Answer - creating a sequence
of instructions to solve a problem
Algorithm Correct Answer - A sequence of instructions that
solves a problem
Python interpreter Correct Answer - a computer program that
executes code written in the Python programming language
Interactive interpreter Correct Answer - a program that allows
the user to execute one line of code at a time
Code Correct Answer - a common word for the textual
representation of a program
,Line Correct Answer - A row of text
Prompt Correct Answer - Informs the programmer that the
interpreter is ready to accept commands
Interpreter Correct Answer - A program that executes
computer code.
Statement Correct Answer - program instruction
Expressions Correct Answer - Code that returns a value when
evaluated; for example, the code wage * hours * weeks is an
expression that computes a number.
Variables Correct Answer - named references to values stored
by the interpreter
Assignment Correct Answer - Used to create a new variable
using the = symbol
Print Correct Answer - displays variables or expression values
Comment Correct Answer - To explain portion of code by a
human reader using the # symbol
What is the purpose of variables? Correct Answer - Store
values for later used to refer to values saved in memory by the
interpreter.
Expressions Correct Answer - are code that yield a value when
evaluated, such as 20 * 40, which yields the value of 800
, How are most Python programs developed? Correct Answer -
Writing code in files - The Python interpreter can load and execute
Python code saved in files
string literal Correct Answer - text enclosed in quotes, may
have letters, numbers, spaces , or symbols.
Given the variable num_cars = 9, which statement prints 9?
Correct Answer - print(num_cars)
newline character Correct Answer - "\n" moves output to the
next line
Whitspace Correct Answer - Any space, tab or newline
Input function Correct Answer - Causes the interpreter to wait
until the user has entered some text and has pushed the return key
string Correct Answer - It simply represents a sequence of
characters.
Which statement reads a user-entered string into variable
num_cars? Correct Answer - num_cars = input ()
Type Correct Answer - Determines how a value can behave.
For example, integers can be divided by 2, but not strings ex 'Hello'
int function Correct Answer - can be used to convert that
string to the integer for numbers
Type a statement that converts the string '15' to an integer and
assigns my_var with the result. Correct Answer - my_var =
int('15")
With Applicable Solutions
Program Correct Answer - Consists of instructions executed
one at a time
Input Correct Answer - A program gets data, perhaps from a
file, keyboard, touchscreen, network.
Process Correct Answer - A program performs computations
on that data, such as adding two values like x + y
Output Correct Answer - A program puts that data
somewhere , such as to a file, screen, or network
Variables Correct Answer - Refer to data , like x, y, and z.
Triangle's area Correct Answer - 1/2(base)(height)
Computational thinking Correct Answer - creating a sequence
of instructions to solve a problem
Algorithm Correct Answer - A sequence of instructions that
solves a problem
Python interpreter Correct Answer - a computer program that
executes code written in the Python programming language
Interactive interpreter Correct Answer - a program that allows
the user to execute one line of code at a time
Code Correct Answer - a common word for the textual
representation of a program
,Line Correct Answer - A row of text
Prompt Correct Answer - Informs the programmer that the
interpreter is ready to accept commands
Interpreter Correct Answer - A program that executes
computer code.
Statement Correct Answer - program instruction
Expressions Correct Answer - Code that returns a value when
evaluated; for example, the code wage * hours * weeks is an
expression that computes a number.
Variables Correct Answer - named references to values stored
by the interpreter
Assignment Correct Answer - Used to create a new variable
using the = symbol
Print Correct Answer - displays variables or expression values
Comment Correct Answer - To explain portion of code by a
human reader using the # symbol
What is the purpose of variables? Correct Answer - Store
values for later used to refer to values saved in memory by the
interpreter.
Expressions Correct Answer - are code that yield a value when
evaluated, such as 20 * 40, which yields the value of 800
, How are most Python programs developed? Correct Answer -
Writing code in files - The Python interpreter can load and execute
Python code saved in files
string literal Correct Answer - text enclosed in quotes, may
have letters, numbers, spaces , or symbols.
Given the variable num_cars = 9, which statement prints 9?
Correct Answer - print(num_cars)
newline character Correct Answer - "\n" moves output to the
next line
Whitspace Correct Answer - Any space, tab or newline
Input function Correct Answer - Causes the interpreter to wait
until the user has entered some text and has pushed the return key
string Correct Answer - It simply represents a sequence of
characters.
Which statement reads a user-entered string into variable
num_cars? Correct Answer - num_cars = input ()
Type Correct Answer - Determines how a value can behave.
For example, integers can be divided by 2, but not strings ex 'Hello'
int function Correct Answer - can be used to convert that
string to the integer for numbers
Type a statement that converts the string '15' to an integer and
assigns my_var with the result. Correct Answer - my_var =
int('15")