


















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!



















◉ 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. ◉ Hot Water State. Answer: Water is 'Hot' if the temperature is between 115° F and 211° F. ◉ Boiling Water State. Answer: Water is 'Boiling' if the temperature is greater than or equal to 212° F. ◉ water_state. Answer: Describes the state of water based on temperature. ◉ optional_safety_comment.
◉ 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.
Answer: The program tries to use a variable that does not exist. ◉ type error. Answer: An operation uses incorrect types - can occur if adding an integer to a string. ◉ logic error (bug). Answer: Program runs but does the wrong thing. ◉ whitespace. Answer: Any blank space or new line. ◉ = (assignment operator). Answer: Assigns a variable with a value. ◉ incrementing. Answer: Increasing variables by a value of 1. ◉ float( ). Answer: A number with a decimal point. ◉ 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.
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. ◉ Example of stock selection. Answer: TSLA, BBBY, AAPL, SOFI, KIRK, AURA, AMZN, EMBK, LVLU ◉ Example of grocery items. Answer: bananas, steak, cookies, celery, milk ◉ Output new file contents. Answer: The contents of the file after appending the new sentence.
◉ Cost per item. Answer: The cost assigned to each grocery item in the purchase dictionary. ◉ Cost per stock selection. Answer: The cost assigned to each stock in the stocks dictionary. ◉ factorial() method. Answer: A method from the math module used to calculate the factorial of an integer. ◉ input. Answer: A function used to get text from user. ◉ variable. Answer: A named item used to hold a value. ◉ Algorithm. Answer: Sequence of instructions that solves a problem. ◉ python interpreter or IDE.
◉ 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 ◉ IPO thinking standard. Answer: Input-Process-Output thinking standard to determine coding structure ◉ name. Answer: A special variable in Python that holds the name of the current module
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.
◉ Precedence. Answer: Enforcing order of operations using parentheses, e.g., 3 * (2+1) = 9 ◉ Data type check. Answer: Using type() to find the data type of a variable or value ◉ List. Answer: An ordered and changeable collection in Python allowing duplicates ◉ Set. Answer: An unordered and immutable collection in Python, allowing addition/removal but no duplicates ◉ Tuple. Answer: An ordered and unchangeable collection in Python, allowing duplicates and faster operations ◉ 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