



















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
ā 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: Safety comment displayed based on specific water temperatures. ā temperature. Answer: The current temperature of the water. ā Frozen. Answer: State of water when temperature is less than 33° F. ā Cold. Answer: State of water when temperature is between 33° F and 80° F. ā Warm. Answer: State of water when temperature is between 80° F and 115° F. ā Hot. Answer: State of water when temperature is between 115° F and 212° 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.
ā 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. ā F strings. Answer: Allows for easy formatting of strings in Python. ā dictionary. Answer: Data structure with key-value pairs, where keys must be unique. ā name error.
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.
ā 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. ā 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.
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.
ā main. Answer: A special variable in Python that indicates the main module ā Python Crash Course Book. A nswer: A resource for learning Python programming ā Public API's. Answer: Application Programming Interfaces accessible to the public ā Pomodoro Technique. Answer: Time management method using a timer to break work into intervals ā Dictionaries. Answer: Data structure with key-value pairs used for mapping inputs to outputs ā CS50. Answer: An introductory course to computer science offered by Harvard University ā 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
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 ā Corey Schaefer. Answer: A notable resource for learning programming through tutorials and guides ā Bro Code Playlist. Answer: A collection of programming tutorials and resources ā Type conversion/casting. Answer: Converting a value to a different data type, e.g., int('1') returns 1 as an integer
ā 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