Font size
WorksheetsProgramming Basics and Concepts Quiz
Total questions: 30
Worksheet time: 35mins
What is a variable (container) in programming?
Variables are identifiers that store information.
Variables are used to perform calculations.
Variables are a type of data structure.
Variables are a type of function.
What are good practices in naming variables?
Use the alphabet, underscores, and numbers.
Start a variable with a number or underscore.
Use special characters.
Use reserved words in the programming language.
List and explain two common variable naming conventions.
snake_case is a naming convention used for modules, variables, class, and functions which utilized lower case letters and underscores in between multiple words.
CamelCase is a naming convention used for class names which utilizes capital letters at the beginning of each word without spaces in between.
What is a flow chart?
A flowchart is a visual representation of an algorithm.
A flowchart is a type of data structure.
A flowchart is a programming language.
A flowchart is a type of function.
What is an algorithm?
A set of instructions or procedures designed to perform a specific task or solve a problem.
A type of data structure.
A programming language.
A type of function.
Describe a conditional statement and how it is used in an algorithm.
Define syntax.
Set of rules that define what the various combinations of symbols mean. This tells the computer how to read the code.
A type of data structure.
A programming language.
A type of function.
How are Python statements executed?
Execution always begins at the first statement of the program. Statements are executed one at a time, in order, from top to bottom.
Execution begins at the last statement of the program.
Statements are executed randomly.
Execution begins at the middle of the program.
Classify the 3 types of programming errors. Give an example of each.
List the data types we have used in our programs. Give an example of each.
What is the purpose of the type() function?
The type function is used to get the data type of an object passed as a parameter.
The type function is used to convert data types.
The type function is used to print data.
The type function is used to input data.
What is the purpose of the print() function?
The print function prints a specified message (as a parameter) to the screen or output device.
The print function inputs data.
The print function converts data types.
The print function calculates data.
Give one example of the print function outputting a string and one example outputting a numeric value.
What is the difference between the output of the following two lines of code: print(“Hello” + “World!”) and print(“Hello”, “World!”)?
Describe the input() function.
Give two examples of a logical expression.
variable
A graphic character on the screen with properties that describe its location, movement, and look.
a series of images that create the illusion of motion by being shown rapidly one after the other
a single image within an animation
A placeholder for a piece of information that can change.
Part of a program is shown.
What happens in Lines 3 to 6 when the value 2.0 is entered at Line 2?
"Failed to qualify" message is displayed
"Congratulations" message is displayed
No message is displayed
Both messages are displayed
These blocks are not loops:
A diagram that represents an algorithm, work flow, or process, and uses geometric symbols connected by arrows to show the direction of the flow of action.
Flowchart
Illustration
Data
Information
Define flowchart?
A diagram that shows only circles
A diagram that represents an algorithm, work flow, with symbols.
Has a beginning but no end.
A chart of no direction of a project.
What shape would indicate the flow of the program?
oval
recatangle
parallelogram
arrow
Which of these is true?
A syntax error will stop a program running
A logic error will stop a program running
A syntax error will let the program run but may have unexpected outcomes
The program will always show an error message for a logic error
Which code segment results in "true" being returned if a number is even? Replace "MISSING CONDITION" with the correct code segment.
num % 2 == 0;
num % 0 == 2;
num % 1 == 0;
num % 1 == 2;
The ______________ checks its Boolean condition.
If the condition is true, the block(s) held inside it will run.
If the condition is false, the code inside the block will be ignored.
print("3+4")
Which of the following is used to represent a Boolean value of True in Python?
"True"
1
True
What type of error in this code will be found by the Autograder?
Rect(124,27,11,89
Runtime Error
Syntax Error
Logical Error
There is NO error
