Docsity

WGU C859 PYTHON TEST 78 COMPLETE TEST PAPER WITH CORRECT ANSWERS, Exams of Object Oriented Programming

Toggle sidebar
bg1
WGU C859 PYTHON TEST 78 COMPLETE TEST
PAPER WITH CORRECT ANSWERS
โ—‰ An efficient, comparison-based sorting algorithm.
Answer: Merge Sort
โ—‰ Ordered collection of items in Python denoted by square brackets.
Answer: Lists
โ—‰ Immutable ordered collection of items in Python denoted by
parentheses.
Answer: Tuples
โ—‰ Symbols used to represent values and perform operations.
Answer: Variables and Expressions
โ—‰ Blocks of organized, reusable code for specific tasks.
Answer: Functions
โ—‰ Guided demonstrations of critical programming exercises.
Answer: Lab Walkthroughs
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download WGU C859 PYTHON TEST 78 COMPLETE TEST PAPER WITH CORRECT ANSWERS and more Exams Object Oriented Programming in PDF only on Docsity!

WGU C859 PYTHON TEST 78 COMPLETE TEST

PAPER WITH CORRECT ANSWERS

โ—‰ An efficient, comparison-based sorting algorithm. Answer: Merge Sort โ—‰ Ordered collection of items in Python denoted by square brackets. Answer: Lists โ—‰ Immutable ordered collection of items in Python denoted by parentheses. Answer: Tuples โ—‰ Symbols used to represent values and perform operations. Answer: Variables and Expressions โ—‰ Blocks of organized, reusable code for specific tasks. Answer: Functions โ—‰ Guided demonstrations of critical programming exercises. Answer: Lab Walkthroughs

โ—‰ Symbols used to perform mathematical operations in Python. Answer: Arithmetic Operators โ—‰ Operations that return true or false based on the comparison of values. Answer: Comparisons โ—‰ Increasing the value of a variable by a specified amount. Answer: Incrementing โ—‰ Function to obtain the magnitude of an integer, removing the negative sign. Answer: Absolute value function โ—‰ Function to round a value to a specified number of digits after the decimal point. Answer: Round function โ—‰ Statements used for repeated execution of instructions in a program. Answer: Iteration Statements

โ—‰ Converting a value to a different data type, e.g., int('1') returns 1 as an integer. Answer: Type conversion/casting โ—‰ Enforcing order of operations using parentheses, e.g., 3 * (2+1) =

Answer: Precedence โ—‰ Using type() to find the data type of a variable or value. Answer: Data type check โ—‰ An ordered and changeable collection in Python allowing duplicates. Answer: List โ—‰ An unordered and immutable collection in Python, allowing addition/removal but no duplicates. Answer: Set โ—‰ An ordered and unchangeable collection in Python, allowing duplicates and faster operations. Answer: Tuple

โ—‰ Unable to be changed, e.g., tuple elements. Answer: Immutable โ—‰ Dividing integers to get the whole number part of the quotient. Answer: Floor division โ—‰ Estimates average calories burned based on age, weight, heart rate, and time. Answer: Calories burned equation โ—‰ Using math library for operations like power, absolute value, and square root. Answer: Math functions โ—‰ Calculating frequencies of keys on a piano based on initial key frequency. Answer: Frequency calculation โ—‰ Time taken for a substance to reduce to half its original value. Answer: Half-life โ—‰ Outputting price change and estimated monthly mortgage based on current and last month's price.

โ—‰ Score names: 'Eagle' (2 less than par), 'Birdie' (1 less), 'Par' (equals par), 'Bogey' (1 more); 'Error' if par not 3, 4, or 5. Answer: Golf Scores โ—‰ Used for multiple choices. 'if' for an option, 'elif' for alternatives, 'else' as the final option if none apply. Answer: Conditional Statements โ—‰ Used to iterate a specific number of times or through elements in a list. Answer: For Loop โ—‰ Used to iterate until a condition is met, breaking based on a condition rather than a specific number of iterations. Answer: While Loop โ—‰ Loops within loops, used for complex iterations and operations. Answer: Nested Loops โ—‰ Lists within lists, used for organizing and managing complex data structures. Answer: Nested Lists

โ—‰ Returns a sequence of numbers, commonly used in for loops. Answer: Range Function โ—‰ Iterating through a list to find the smallest and largest values. Answer: Smallest and Largest Numbers in a List โ—‰ Method to add elements to the end of a list. Answer: Append โ—‰ Used to exit a loop based on a certain condition, instead of relying on the condition to become false. Answer: Break Statement โ—‰ Representing an integer in reverse binary by outputting remainders of division by 2. Answer: Reverse Binary โ—‰ Used to separate the main code from the function's code for unit testing. Answer: name == 'main' โ—‰ Function taking miles per gallon, price per gallon, and miles driven to return the dollar cost.

โ—‰ Function that checks if a string represents an integer. Answer: check_integer_string โ—‰ Activity where user provides words to complete a story in unexpected ways. Answer: Mad Libs โ—‰ Built-in function to keep track of the number of iterations in a loop. Answer: enumerate โ—‰