












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!













⩥ Formatted Student ID Output. Answer: The output format for the student ID is . ⩥ Input Validation for Student ID. Answer: The student ID must be between 100000000 and 999999999. ⩥ Formatted ID Construction. Answer: The formatted ID is constructed using parts derived from the student ID. ⩥ Predefined List. Answer: A list containing the values [4, - 27, 15, 33, - 10]. ⩥ Boolean Value Output. Answer: Indicates whether the input value is greater than the maximum value from predef_list. ⩥ Max Value Calculation. Answer: The maximum value from predef_list is calculated using the max() function.
⩥ Frameworks List. Answer: A list of web frameworks: ['Django', 'Flask', 'CherryPy', 'Bottle', 'Web2Py', 'TurboGears']. ⩥ Index Value Input. Answer: An integer input representing the index of a string element in the frameworks list. ⩥ Exception Handling. Answer: A try block that raises an 'Error' for incompatible integer inputs. ⩥ Water Temperature Input. Answer: An integer input representing water temperature in degrees Fahrenheit. ⩥ Water State Description. Answer: Describes the state of water based on temperature ranges. ⩥ Frozen Water State. Answer: Water is 'Frozen' if the temperature is below 33° F. ⩥ Cold Water State. Answer: Water is 'Cold' if the temperature is between 33° F and 80° F. ⩥ Warm Water State. Answer: Water is 'Warm' if the temperature is between 80° F and 115° F.
⩥ Boiling. Answer: State of water when temperature is 212° F or higher. ⩥ Caution: Hot!. Answer: Safety comment displayed when water temperature is exactly 212° F. ⩥ Watch out for ice!. Answer: Safety comment displayed when water temperature is less than 33° F. ⩥ Reverse Binary. Answer: Representing an integer in reverse binary by outputting remainders of division by 2. ⩥ name == 'main'. Answer: Used to separate the main code from the function's code for unit testing. ⩥ Driving Cost Function. Answer: Function taking miles per gallon, price per gallon, and miles driven to return the dollar cost. ⩥ Coin Flip Function. Answer: Function returning 'Heads' or 'Tails' based on a random value of 1 or 0. ⩥ Unit Tests. Answer: Testing small parts of a program in an isolated manner to ensure they work as expected.
⩥ Unit test. Answer: Evaluates individual functions for correctness and proper naming, parameters, and return type. ⩥ kilo_to_pounds(). Answer: Function that converts weight in kilograms to pounds. ⩥ swap_values. Answer: Function that swaps the positions of four integers. ⩥ check_integer_string. Answer: Function that checks if a string represents an integer. ⩥ Mad Libs. Answer: Activity where user provides words to complete a story in unexpected ways. ⩥ enumerate. Answer: Built-in function to keep track of the number of iterations in a loop. ⩥ for loop. Answer: Repeats an action for everything in a container. ⩥ while loop. Answer: Repeats an action based on a condition. ⩥ range() function. Answer: Generates a sequence of numbers within a specified range.
⩥ stocks. Answer: {'TSLA': 912.86 , 'BBBY': 24.84, 'AAPL': 174.26, 'SOFI': 6.92, 'KIRK': 8.72, 'AURA': 22.12, 'AMZN': 141.28, 'EMBK': 12.29, 'LVLU': 2.33} ⩥ purchase. Answer: {"bananas": 1.85, "steak": 19.99, "cookies": 4.52, "celery": 2.81, "milk": 4.34} ⩥ cost_of_stocks. Answer: Total cost of the purchased shares of stock calculated from the stock selections. ⩥ total_purchase_cost. Answer: Total cost of the grocery store items purchased, adjusted for discounts based on quantity. ⩥ discount for 10-20 items. Answer: If between ten and twenty items (inclusive) are purchased, the purchase gets a 5% discount. ⩥ discount for 21 or more items. Answer: If twenty-one or more items are purchased, the purchase gets a 10% discount. ⩥ sentence. Answer: A new sentence string composed of three existing words from a text file. ⩥ file_name. Answer: The name of a text file or CSV file input by the user.
⩥ CSV file. Answer: A file containing two rows of comma-separated values to be imported as dictionaries. ⩥ num_stock. Answer: An integer input identifying how many shares of stock are to be purchased. ⩥ item_purchased. Answer: A string input representing a grocery store item. ⩥ num_items. Answer: An integer input identifying the number of items purchased. ⩥ Total price output format. Answer: Output format for stock purchase: Total price: $cost_of_stocks ⩥ Grocery purchase output format. Answer: Output format for grocery purchase: item_purchased $total_purchase_cost ⩥ File read and write. Answer: Using open(), write(), and read() methods to interact with a text file. ⩥ Dictionary creation from CSV. Answer: Creating a dictionary of key:value pairs for each row of comma-separated values in a CSV file.
⩥ Algorithm. Answer: Sequence of instructions that solves a problem. ⩥ python interpreter or IDE. Answer: Program that executes Python programming. ⩥ code. Answer: Textual representation of a program. ⩥ line. Answer: Row of text. ⩥ prompt. Answer: Indicates the interpreter is ready to accept user input. ⩥ statement. Answer: Line of executable code. ⩥ expression. Answer: Returns a value when evaluated. ⩥ print( ). Answer: Displays output to the screen and starts a new line. ⩥ # or """. Answer: Denotes a comment. ⩥ string literal. Answer: Text enclosed in quotes. ⩥ end=' '. Answer: Keeps multiple print statements on one line.
⩥ type( ). Answer: Determines how a value can behave. ⩥ int( ). Answer: Converts string to an integer. ⩥ syntaxes error. Answer: A violation of the program language rules on how symbols can be defined. ⩥ runtime error. Answer: The program attempts an impossible operation. ⩥ indentation error. Answer: Lines inside the program are not properly indented. ⩥ Value Error. Answer: Invalid value used. ⩥ input_pig_age. Answer: An integer input representing the age of a pig. ⩥ converted_pig_age. Answer: The human equivalent age of a pig calculated using the pigAge_converter() function. ⩥ Reverse Course. Answer: A learning method involving video lectures at home and labs in class
⩥ Merge Sort. Answer: An efficient, comparison-based sorting algorithm ⩥ Lists. Answer: Ordered collection of items in Python denoted by square brackets ⩥ Tuples. Answer: Immutable ordered collection of items in Python denoted by parentheses ⩥ Variables and Expressions. Answer: Symbols used to represent values and perform operations ⩥ Functions. Answer: Blocks of organized, reusable code for specific tasks ⩥ Lab Walkthroughs. Answer: Guided demonstrations of critical programming exercises ⩥ Arithmetic Operators. Answer: Symbols used to perform mathematical operations in Python ⩥ Comparisons. Answer: Operations that return true or false based on the comparison of values
⩥ Absolute value function. Answer: Function to obtain the magnitude of an integer, removing the negative sign ⩥ Round function. Answer: Function to round a value to a specified number of digits after the decimal point ⩥ Iteration Statements. Answer: Statements used for repeated execution of instructions in a program ⩥ Codewars. Answer: An educational coding platform for honing programming skills ⩥ Data Camp. Answer: An online platform offering data science and analytics courses ⩥ Springboard Python course. Answer: A comprehensive course for learning Python programming ⩥ Python compiler. Answer: A program that translates Python code into machine code ⩥ Slicing. Answer: Extracting a portion of a sequence like a string or list in Python
⩥ Immutable. Answer: Unable to be changed, e.g., tuple elements ⩥ Floor division. Answer: Dividing integers to get the whole number part of the quotient ⩥ Calories burned equation. Answer: Estimates average calories burned based on age, weight, heart rate, and time ⩥ Math functions. Answer: Using math library for operations like power, absolute value, and square root ⩥ Frequency calculation. Answer: Calculating frequencies of keys on a piano based on initial key frequency ⩥ Half-life. Answer: Time taken for a substance to reduce to half its original value ⩥ House real estate summary. Answer: Outputting price change and estimated monthly mortgage based on current and last month's price ⩥ Simple statistics. Answer: Calculating product and average of floating-point numbers, rounding and formatting the output
⩥ Northern hemisphere seasons. Answer: Determining the season based on input date and month, considering days in each month ⩥ Seasons. Answer: Spring: March 20 - June 20, Summer: June 21 - September 21, Autumn: September 22 - December 20, Winter: December 21 - March 19 ⩥ Leap Year. Answer: A year with 366 days, occurring every 4 years and divisible by 4, except for century years not divisible by 400 ⩥ Interstate Highway Numbers. Answer: Primary highways: 1-99, odd for north/south, even for east/west. Auxiliary: 100-999, servicing the rightmost two digits of the primary highway ⩥ Golf Scores. Answer: Score names: 'Eagle' (2 less than par), 'Birdie' ( less), 'Par' (equals par), 'Bogey' (1 more); 'Error' if par not 3, 4, or 5 ⩥ Conditional Statements. Answer: Used for multiple choices. 'if' for an option, 'elif' for alternatives, 'else' as the final option if none apply ⩥ Nested Loops. Answer: Loops within loops, used for complex iterations and operations ⩥ Nested Lists. Answer: Lists within lists, used for organizing and managing complex data structures
⩥ scope. Answer: Variable created inside a function ⩥ :. Answer: ___ says a block of code will follow ⩥ find(x). Answer: returns the index of the first occurrence of x in the string ⩥ travels. Answer: Distance: total_miles_traveled miles - accepts three integer inputs representing the number of times an employee travels to a job site ⩥ miles_per_employee. Answer: a dictionary containing the miles per employee commute to the job site: {'A': 15.62, 'B': 41.85, 'C': 32.67} ⩥ ounces. Answer: Create a solution that accepts an integer input representing any number of ounces ⩥ Tons: value_1 Pounds: value_2 Ounces: value_3. Answer: output format for ounces conversion based on the input ounces value ⩥ various_data_types. Answer: a list containing [516, 112.49, True, 'meow', ('Western', 'Governors', 'University'), {'apple': 1, 'pear': 5}]
⩥ data_type. Answer: output data type based on the input index value of the list element using type() ⩥ Trapezoid Area Formula. Answer: A = [(b1 + b2) / 2] * h ⩥ area_value. Answer: the exact area of the trapezoid calculated using the trapezoid area formula ⩥ integer_sum_value. Answer: sum of five inputs maintained as integer values ⩥ float_sum_value. Answer: sum of five inputs converted to float values ⩥ string_sum_value. Answer: sum of five inputs converted to string values (concatenate) ⩥