



















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