Digital Dictionary PDF

Summary

This digital dictionary provides definitions of various computer programming terms. It covers topics like absolute value, abstraction, algorithms, and more. It's a useful reference for beginners or those looking for a quick refresher.

Full Transcript

JITHEASH’S DIGITAL DICTIONARY Search using ctrl + f A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A Absolute Value: ○ Th...

JITHEASH’S DIGITAL DICTIONARY Search using ctrl + f A B C D E F G H I J K L M N O P Q R S T U V W X Y Z A Absolute Value: ○ The number itself, ignoring whether it’s - or + Abstraction: ○ Hides the details; gives you less control ○ The title of the recipe, without needing to see the steps ○ The title “go to the bathroom” without needing instructions ○ Like the art, there are almost no details, it’s just one blob ○ Opposite of algorithm ○ In coding, examples include creating functions, variables, etc. - even block-based code is an abstraction (need less skill) Algorithm: ○ The sequence of instructions to solve a problem; The step-by-step details ○ VERY detailed (the steps for “go to the bathroom” and instructions for the recipe) ○ Gives you the most control ○ Opposite of abstraction American Standard Code for Information Interchange (ASCII): ○ Most common character encoding format for text data on computers and internet ○ Very basic text without formatting, or “plain text”, which is automatically created by Notepad.exe, or you can save a Doc or Word file as “text only” ○ Click to check Unicode text values in zyBooks (2.11.4) ○ Click for link to the table Append: ○ To add something Application (App): ○ See program Argument (or Parameter): ○ The item(s) passed to a function in its parentheses ○ Separate multiple arguments with commas ○ Python uses the word argument, some other languages use the word “parameter” ○ Example: import math num = 49 num_sqrt = math.sqrt(num) “num” is the argument inside the function print(num_sqrt) 7.0 Assembler: ○ Programs made to automatically translate assembly language instructions into machine instructions ○ Human-readable processor instructions Assembly [Language Instructions]: ○ A 1940’s language slightly easier for humans to understand that was then translated using an assembler Assignment Statement: ○ Gives a value to a variable ○ Basically any time there’s an equal sign (just one), it’s an assignment statement ○ Left side must be variable name, then equal sign (“PUTS”) the right side’s value into the variable, which can be an expression ○ If the directions say “assign” that means create a variable ○ Examples: my_age = 14 years_of_high_school = 4 graduation_age = my_age + years_of_high_school print(graduation_age) 18 years_til_18 = 18 - my_age print(years_til_18) 4 blended_family_siblings_total = 6 + 2 print(blended_family_siblings_total) 8 Automatic Memory Management (AMM): ○ A way that an OS or program automatically manages the allocation and deallocation of memory so a programmer does not have to write code to perform memory management tasks when writing a program ○ Learn more on techopedia B Backwards Compatible: ○ Means that older versions of something can run successfully on newer versions Base: ○ Base 2: Numbers 0, 1 (binary) Each digit’s place is “weighted” by increasing powers of 2 Table 3.10.2 ○ Base 10: Numbers 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Each digit’s place is “weighted” by increasing powers of 10 Table 3.10.1 Basic Input/Output System (BIOS): ○ The first program run when turning on a computer ○ Sets up the computer’s basic peripherals ○ Usually stored at memory location 0 Binary Numbers: ○ 0’s and 1’s ○ Often used in bits for base 2 Bits (or Binary Digits): ○ The smallest unit of data a computer can store (2 slots) ○ Word comes from combo of the words binary digits ○ Ways it can be represented: 0 / 1 (usually) True / False On / Off Yes / No ○ Side Note: A computer can only hold so much. They are usually made to hold 32 or 64 bits for a variable (which limits the size/range of numbers that a variable can hold), but Python does some programming magic and moves memory around so it can hold much larger numbers. So we don’t really have to worry about it, this is just useful info. Bug (or Logic Error): ○ A coding error in a computer program that occurs when the logic is flawed ○ When code does not work as expected ○ An error subtle enough to silently misbehave (no crashing or runtime errors) ○ Got its name when Grace Hopper discovered a moth preventing a Harvard computer from working - they taped it in a log book ○ How to avoid Be knowledgeable in the language Check code periodically, not just at the end (write a few statements at a time) Byte: ○ A sequence (ordered flow) of 8 bits treated as one whole unit (read together) ○ If using base 2, this means that the highest number that can be represented is 255 C Cache: ○ The small amount of volatile RAM that may be on a processor’s own chip to give the fastest access ○ It is accessible in one clock tick instead of several ○ Used to maintain a copy of the most-used instructions/data Camel Case: ○ A naming convection that when you name things, separate words by starting every new word (except the first one) with a capital letter instead of an underscore ○ Example: camelCase vs camel_case Case Sensitive: ○ Means uppercase and lowercase letters are seen differently Central Processing Unit (CPU): ○ See processor or microprocessor Circuits: ○ Connections of switches Clock: ○ Measures and governs the rate of speed that a processor’s instructions execute ○ It ticks at a specific frequency ○ It executes about one instruction per clock tick (so millions or billions of instructions per second) ○ Miss Haan is not good at explaining this one - find a video? ○ Examples: 1 MHz (1 million ticks per second) for an inexpensive ($1) processor, like in a microwave or washing machine 1 GHz (1 billion ticks per second) for more expensive ($10-$100) processors, like in a smartphone or computer Code: ○ The textual representation of a program (because for a computer it’s actually all binary numbers, but that’s hard for us to understand) Code Point: ○ The unique number used to represent every possible character using Unicode Compilers: ○ Programs that automatically translate high-level language programs into low-level machine instructions, or executable programs Computational Thinking: ○ Creating a sequence of instructions to solve a problem ○ Helps us work logically through big problems by breaking them down into smaller pieces, looking for patterns, and using the information to come up with a step-by-step solution Computer: ○ Basically a processor interacting with a memory ○ Before the 1940’s and 1950’s it was used in reference to a human that did computations by hand ○ Now includes PC’s (personal computers), laptops, book readers, smart phones, tablets, iPads, and even computing devices embedded in other electronic devices (like medical equipment, automobiles, consumer electronics, and military systems) Concatenate: ○ To join together Core: ○ Each of the several processors contained within one of several billion transistors within an IC Crash: ○ Sudden and accidental end of a program (often due to a runtime error) ○ Abrupt and unintended termination D Data Type (or Type): ○ Determines how a value or object can behave ○ The category of information (like labeling something name, date, etc.) ○ What kind of information is going somewhere (and what is allowed) ○ See type() in python pedia ○ Types (See Visual Aid): Boolean Numeric Types Floating-Point Integer ○ Examples: Integers can be added and multiplied Strings can be appended (added, not mathematically) with additional text or concatenated together Debugging: ○ The process of finding and fixing bugs; troubleshooting Identify problem Isolate source of problem Correct problem OR find a workaround Test correction/workaround Decrementing: ○ Decreasing by a set amount over and over again ○ Opposite is incrementing ○ Example with each punch in a video game being -2 health health = 40 punch_value = 2 (why is this not -2? It negates the - below) health = health - punch_value Shortcut: health -= punch_value (also for /=) Disk (or Hard Drive): ○ A storage-type non-volatile hardware that stores files and other data like files, songs, movies, documents, etc. differently than flash ○ How it works: Is non-volatile by aligning magnetic particles in a 0 or 1 spot The disk spins under a head that pulses electricity at just the right times to adjust specific particles E End-of-Life: ○ When something officially has no more improvements, fixes, or support (even if there are security problems); sunset Error: ○ Can include whitespace in zyBooks (like it expects a space or newline) ○ Kinds of errors: Logic (bug) Runtime Syntax Overflow ○ ○ ○ OverflowError: Overflow occurs when a value is too large to be stored in the memory allocated by the interpreter A standard 32-bit installation of Python… Maximum floating-point value is approximately 1.8x10308 Minimum floating-point value is 2.3x10-308 Error is created when you assign a floating-point value outside of the allowed range Escape Sequence: ○ Two-item sequences that are understood in the IDE as the start of a special character’s instructions The first item, or the backslash (\), tells the interpreter to display (show), exempt (ignore), or create something Based on the second item ○ See the escape sequences in python pedia ○ Can be ignored using a raw string (see r in python pedia) ○ Evaluate: ○ Kinda like DOING the math (you can tell 5 * 5 is supposed to do something) ○ The process of an expression “evaluating” to a value ○ Done in order of operations, called “precedence rules” in programming ○ Example: x = 5 x = x + 1 evaluates to 6 y = x + 1 assigns y with 6 Executable (or Executable Program): ○ A sequence of machine instructions together Execute: ○ Basically, run; run a program Expression: ○ Code that returns a value when evaluated (like 5 * 5 = 25) ○ A combination of items, like variables, literals, operators, and parentheses, that evaluates to a value, like 2 * (x + 1) ○ Often used on the right side of an assignment statement F Flash [Storage]: ○ Storage devices that store the 0’s and 1’s in a non-volatile memory rather than disk ○ How it works Tunnels electrons into special circuits on the memory’s chip Removes them with a “flash” of electricity that draws electrons back out Float (or Floating-Point): ○ A data type that is a real number that CAN include a decimal, but does NOT HAVE TO ○ The name refers to the decimal point appearing anywhere (“floating”) in the number ○ See float() in python pedia ○ Watch for OverflowError ○ Only accurate up to 15 decimal places, 16th place can be inaccurate ○ By default, most programming languages output at least 5 digits after the decimal ○ In general, floating-points should be used to represent quantities that are measured, such as distances, temperatures, volumes, and weights ○ Takes up more memory than an integer ○ Python automatically ignores extra zeros present at the number’s end ○ Examples: 1.0, -898.450, 8949.250, 5.5, 0.25, -13.79 ○ Click for a link about floating-point types ○ Floating Point Literal: A number written with the fractional part, even if that fraction is zero Example: 1.0, 0.0, 99.0 Format Specification: ○ A rule for how something should be formatted ○ Putting it inside a replacement field lets the value’s formatting in the string be customized ○ See more details in python pedia ○ How-to: Formatted: { what : how } What: an expression to be evaluated, even just a variable or a value How: special characters that say how it should look Formatted String Literal (f-string): ○ Used to format strings (see f-string in python pedia) ○ With a replacement field: Allows a programmer to output (print) a string with a replacement field (placeholder) that is evaluated (filled in or understood) as the program executes ○ With a formatting specifier: Allows the programmer to output a number with a minimum/maximum number of decimal places Function: ○ A list of statements that can be executed simply by “calling” (referring to) the function’s name ○ Like a recipe title - you don’t have to list the ingredients and steps every time ○ The recipe steps are the algorithm, calling it is an abstraction ○ Similar to a variable that you create a name to hold information ○ Read arguments (usually in parentheses after function name, separated by commas) ○ Example: import math num = 49 num_sqrt = math.sqrt(num) “num” is the argument inside the function print(num_sqrt) 7.0 ○ Function Call: Writing a function’s name to use it The process of invoking a function Form of abstraction G Garbage Collection (GC): ○ A form of AMM built into many programming languages ○ The language will have one or more “garbage collectors” (GC engines) that automatically free up memory space that has been allocated to objects no longer needed by the program ○ Learn more on techtarget Gigabyte: ○ A billion bytes Good (or Best) Practices: ○ Don’t affect the functionality of a program, but rather the experience for the humans who will be reading and maintaining the code ○ Examples: Proper naming conventions Lowercase letters with underscores When dealing with scientific or engineering names, add the unit of measure (not just temperature, but temperature_celcius) Only use abbreviations if widely understood (like tv or app) Whitespace Hitting tab (and enter) for every element (item) in a dictionary To create a new block, pick a consistent indent level can be either 4 spaces (columns) or 1 tab per level Refactoring Comments explaining code Iteration When you open something, close it right away Incremental development Math/Expressions-related: Always use parentheses to make order of evaluation explicit, as it is top of the precedence rules and helps prevent bugs Use a single space around all operators for readability (except for an unary) Floats should not be compared using the equality operators, due to the imprecise representation of floating-point numbers At the top of a program (or the beginning of it) You should list all your import statements Then usually create your variables (don’t scatter throughout your code) H Hardware: ○ The tangible, physical, parts or peripherals of a computer that run things and obtains input and provides output ○ Examples: Keyboard, screen, storage, processors, microphones, USB interfaces, speakers, printers, etc. High-Level Languages: ○ Languages invented in the 1960’s and 1970’s to support programming using formulas or algorithms ○ More abstract and related to human language than machine or assembly ○ Some of the earlier languages were FORTRAN (Formula Translator) or ALGOL (Algorithmic Language) I Identifier (or Name): ○ The title given to something ○ Cannot be used at for any other thing in the program (see identity) ○ In Python: This can include letters, underscores, and digits (0-9), not symbols or spaces This must start with a letter or underscore (try to avoid double underscores) Names are case sensitive Identity: ○ The unique numeric identifier given to each object (like 1, 500, or 45382) ○ Like a SSN or student ID, only one object at any time may have a particular identifier ○ Usually refers to the memory address where the object is stored ○ The built-in function id() can give the value of an object's identity ○ See id() in python pedia Immutable: ○ Means the value’s type cannot be changed ○ Integers and strings are immutable ○ Checking if it can be changed is mutability ○ Think immortal (cannot die) Increment: ○ Incremental Development: A good practice Writing, compiling, and testing a small amount of code, then repeating the process with a small amount more (an increment), etc. You should “save as” and update the file name every couple sections (iteration) ○ Incrementing: Increasing by a set amount over and over again Opposite is decrementing Example with picking up nickels each being worth 5 cents wallet = 0 nickel_value = 2 wallet = wallet + nickel_value Shortcut: wallet += nickel_value (also for *=) Indentation: ○ See whitespace Input: ○ The information that a user gives to a program (usually after having been asked a question); info that a program receives, usually to do something with it ○ Examples: Touchscreen Typing on a keyboard Files I create ○ A program receives (gets) data from a file, keyboard, touchscreen, network, etc. (we then will usually process that data and you should use a print statement to output it) Instruction: ○ A list of calculations for processors to execute ○ Operate on data, which is stored in memory locations as 0’s and 1’s Integer: ○ A data type that allows a number ○ This number CANNOT have decimals ○ This cannot be written with a comma (1234567 not 1,234,567) ○ In general, integers should be used to represent quantities that are counted, such as numbers of cars, students, cities, hours, and minutes ○ See int() in python pedia Integrated Circuit (IC): ○ Transistors integrated into a single chip ○ Following Moore’s Law, there are now several billion transistors containing multiple processors in an IC (each called a core) Integrated Development Environment (IDE): ○ A software that programmers use to build and run code ○ It knows how to interpret code as more than just text Interpreter: ○ Executes a script ○ Slower because it requires multiple interpreter instructions to execute one script instruction ○ BUT it avoids the compilation step during programming and running the same script on different processors as long as each processor has an interpreter installed ○ Interactive Interpreter: A program that allows the user to execute one line of code at a time (the Shell) ○ Python Interpreter: A computer program that executes code written in Python ○ Executes in order: the first line of code at the top all the way to the end (bottom) Irrational Numbers: ○ Numbers that can’t be written as a ratio (simple fraction), and would therefore have infinite numbers after the decimal ○ Click for an explanation ○ Example: 3.1415… Iteration: ○ Saving AS periodically BEFORE you make changes (like every 5 minutes or 5 lines of code) ○ So you can go back to the better soup before you accidentally added ½ cup of garlic like Miss Haan ○ A NAMED version of something ○ Think Iron Man’s versions of his suits: Mark I, Mark II, etc. ○ A good practice J K Keyboard: ○ Hardware that allows users to provide input to a computer Keywords (or Reserved Words): ○ Certain words that the Python language already has a meaning for and therefore cannot be used as programmer-defined names ○ Link to list ○ L Leading Zeros: ○ Zeros before a number, like 007 instead of 7 Line: ○ A row of code Literal: ○ A specific value in code, like 2 ○ Entered directly into the code as is, instead of 1 + 1 Logic Error: ○ See bug M Machine Instructions: ○ Computer instructions that are represented as 0s & 1s Megabyte: ○ A million bytes Memory: ○ A circuit that can store 0’s and 1’s in each of thousands of addressed locations ○ Like a series of mailboxes with address that can each store an envelope (the 0’s and 1’s) ○ The arrangement is similar to a chef (processor) executing the instructions of a recipe (program), where each instruction changes ingredients (data), with the recipe and ingredients kept on a nearby counter (memory). Method: ○ Instructions that tell an object to perform some kind of action ○ Like a function, but associated with an object (a function is not) ○ Used to make general things (classes) do more specific or different things ○ Called using a dot notation ○ See how to execute a method here in python pedia Microprocessor: ○ A term used when processors started to fit on a single chip ○ Continue to get smaller and more capable, following Moore’s Law Module: ○ A file containing Python code that can be used by other modules or scripts ○ Can be made available for use by using the import statement (see python pedia) ○ Import statement should be at the top of the file ○ Use an object (like a variable or function) within the module after import using the dot notation (see python pedia) ○ Splitting code into separate modules makes managing larger programs simpler ○ There are pre-installed useful modules available in the Python Standard Library ○ When it is imported, all code in the module is immediately executed ○ Math Module: A standard module that comes with Python to support more advanced math Includes theoretic, trigonometric, and logarithmic operations Click for list of functions from math module Access by: import math Examples: square root ○ Random Module: Provides methods that return random values Numbers generated are pseudo-random See random() in python pedia See randrange() in python pedia See randint() in python pedia Moore’s Law: ○ The principle that the speed and capability of an IC can be expected to double every 2 years (now 18 months) ○ Came as a result of more and more transistors being able to be contained by a microchip Mouse: ○ Hardware that allows a user to provide input to the computer using graphical displays Mutable: ○ Means a value’s type or contents can be changed ○ Opposite of immutable Mutability: ○ Refers to whether the object's value is allowed to be changed or is immutable ○ Modifying the values with assignment statements results in new objects being created and the names bound to the new object ○ Think TMNT N Name (or Identifier): ○ See identifier Name Binding: ○ The process of associating names with interpreter objects ○ An object can have more than one name bound to it (many people can be 14 years old) ○ Every name is bound to exactly ONE object (but Haan can only be 14, not 14 and 19) ○ Occurs whenever an assignment statement is executed ○ Examples linked in zyBooks 2.3.2 Naming Conventions: ○ Following a system for giving names ○ Give names that make sense, are useful, and cannot easily be confused ○ You should be able to tell what a function/variable is about by its name ○ Good practice ○ Avoid: Also check identifiers and keywords Double underscore before names I i, L l, 1 O o, 0 x Nesting: ○ Placing commands within one another, usually with parenthesis ○ Should not be separate or cross one another (connect into a circle) ○ Think of Russian nesting dolls ○ Correct example: int(input()) ○ Incorrect example: int()input() Non-Volatile: ○ Means the item maintains its contents, even when powered off; opposite of volatile Numeric Type: ○ A data type that supports normal mathematical operations (+,-,*,/, etc.) ○ Includes: Integer Floating-Point O Object: ○ A thing that represents a value and is automatically created by the interpreter when executing a line of code (including integers, strings, functions, lists, etc.) ○ Not explicitly made by the programmer, but rather created and manipulated as needed by the interpreter ○ Interpreter automatically assigns each new object a location somewhere in memory, and when it is no longer needed, it is automatically deleted from memory and thrown away (aka garbage collection) ○ Example: Executing yrs_of_high_school = 4 Creates a new object to represent the value 4 Check 2.3.1 for more examples ○ Properties (every Python object has all 3) Value: The data associated with the object, such as the 4 above, efadfg, or mom Type (or Data Type): The supported behavior of the object, like float or string Object type NEVER changes once created Identity (or Identifier): A unique name that describes the object Open-Source: ○ Means that the community of users participate in creating and defining something Operand: ○ The numbers/variables/values used in an equation ○ Example 5 * 7 The 5 and 7 are operands Operating System (OS): ○ A program that allows a user to run other programs and interfaces (interacts) with many other peripherals Operator: ○ A symbol that performs a built-in calculation (like + does addition) ○ The types of the values being compared determines the meaning of a comparison If both values are numbers, then the numbers are compared arithmetically (5 < 2 is False) Comparisons that make no sense, such as 1 < 'abc', result in a TypeError Comparison of values with the same type, such as 5 < 2, or 'abc' >= 'ABCDEF', depends on the types being compared ○ Specific to types: Numbers are arithmetically compared Strings are compared by converting each character to a number value (ASCII or Unicode), and then comparing each character in order (Most string comparisons use equality operators "==" or "!=", as in today == 'Friday') Lists and tuples are compared via an ordered comparison of every element in the sequence. Every element between the sequences must compare as equal for an equality operator to evaluate to True. Relational operators like < or > can also be used: The result is determined by the first mismatching elements in the sequences. For example, if x = [1, 5, 2] and y = [1, 4, 3], then evaluating x < y first evaluates that 1 and 1 match. Since the first list elements match, neither list can be considered to be less than the other, nor can the lists be declared equal without comparing more elements. So the next elements must be compared. The next elements do not match, so 5 < 4 is evaluated, which produces a value of False. ○ Arithmetic Operators: ○ Compound Operators: Shorthand (or shorter/shortcut) ways to update variables Output: ○ Information that a program gives (its response); info received from the program - usually for a user to see ○ Examples: Your screen A pop-up The letter that shows up when you type on the keyboard ○ If the directions say output, it probably means use the print command (which creates output) ○ Usually after receiving input, you’d like to process and then output it to see what they said and do something with it OverflowError: ○ Overflow occurs when a value is too large to be stored in the memory allocated by the interpreter ○ A standard 32-bit installation of Python… Maximum floating-point value is approximately 1.8x10308 Minimum floating-point value is 2.3x10-308 ○ Error is created when you assign a floating-point value outside of the allowed range P Peripherals: ○ The hardware used to receive input or display output ○ The input/output (I/O) devices Precedence Rules: ○ The order in which an expression is evaluated ○ Good practice: Always use parentheses to make order of evaluation explicit ○ In math, order of operations ○ ○ Process: ○ A program performs computations on input, like x + y Processor (or CPU or Microprocessor): ○ Runs the computer’s programs, reading and executing instructions from memory, performing operations, and reading and writing data to and from memory ○ Computes data, while memory stores data and instructions ○ Because speed (which is maintained by a clock) is important, it may contain a cache ○ How it works: Circuits made to process (or execute) a desired list of calculations When powered on, the processor starts executing the (BIOS) Then it executes the OS program ○ The arrangement is similar to a chef (processor) executing the instructions of a recipe (program), where each instruction changes ingredients (data), with the recipe and ingredients kept on a nearby counter (memory). Program: ○ A programmer-created sequence (goes one at a time, in order) of instructions Programming Language: ○ A language can be scripting and programming ○ Used for larger and more complex software than scripting languages, like an OS ○ The TIOBE Index for most popular programming languages Pseudo…: ○ A prefix that means not actually, but looks like ○ Pseudocode: A detailed (but readable) description of what a computer program should do (that’s easier for humans to understand) ○ Pseudo-Random: The random module has an equation to calculate the next “random” number from the previous one while it invisibly keeps track of the previous one The first time you call any random method, there is no previous random number, so the method uses a seed to help generate the number Despite the appearance of randomness, reproducibility is important for testing Python: ○ A scripting language released in 1994 with the goals of simplicity and readability while maintaining other language’s power and flexibility ○ Facts: Excels at providing powerful programming paradigms such as object-oriented programming and dynamic typing Incurs additional overhead costs because the language is interpreted, and creates slower-executing programs Came from an existing language called ABC Named off of Monty Python’s Flying Circus Python 2.7 is not backwards compatible (see article) Is open-source Python Enhancement Proposal 8 (Pep 8): ○ The Python style guide, very useful for good practices ○ Linked here ○ “Code is read more often than written, so having a consistent variable naming scheme helps to ensure that programmers can understand each other's code” Q R Random-Access Memory (RAM): ○ A computer component that temporarily holds data read from storage (disk or flash) ○ Usually located off the processor chip ○ Designed so any address can be accessed much faster than from a disk ○ “Random access" comes from accessing any memory location quickly and in random order, without spinning a disk to get a proper location under a head ○ More costly per bit than disk because of its higher speed ○ Memory size is typically listed in bits or bytes (megabytes, gigabytes, or terabytes) Reciprocal: ○ In math, it’s the inverse (opposite) negative or opposite ○ Divide it by 1 Refactoring: ○ Using the simplest or most efficient code; simplifying ○ Example pocket_of_coins = pocket_of_coins + 1 pocket_of_coins += 1 Repeating Decimal: ○ Numbers where the “last number” after the decimal would repeat infinitely ○ Example: 4.333333333… Replacement Field: ○ A placeholder expression ○ Its value replaces the expression in the final output, like in an f-string ○ Specify the formatting with a format specification ○ In an f-string, it’s whatever is in { } Respectively: ○ In the order they’re mentioned, separately or individually ○ More specifically in math, if 2 lists are listed, they should be matched up in the same order Runtime Error: ○ An error where the syntax is correct, but the program attempts an impossible operation ○ It may also be given something “unexpected” ○ Can be ValueError, NameError, etc. ○ Example: 0/0 print(‘Hello’ * ‘ABC’) S Screen (or Monitor): ○ Hardware used to display items to a user Scientific Notation: ○ A way of writing very large or very small numbers so it can more conveniently and shortly written in a decimal form ○ Uses an "e" preceding the power-of-10 exponent (see python pedia) ○ Examples: 6.02*1023 is 6.02e23 0.001 is 1*10-3, so written as 1.0e-3 ○ For review, go to 2.4.1 PA Script: ○ A program whose instructions are executed by an interpreter ○ It is a saveable file, not like the Shell Scripting Language: ○ A language created in the 1960’s and 1970’s to execute programs without a need for compilation ○ Used for smaller tasks than programming languages Seed: ○ A built-in integer based on the current time ○ Used in the random module to generate a pseudo-random number ○ Useful because the program will be run at different times each time, so each program will get a unique sequence ○ To reproduce a test run without different integers, see seed() in python pedia Software: ○ The intangible parts of a computer, the programs Statement: ○ A program instruction, usually just on one line ○ A program is usually a series of statements String / String Literal: ○ Generally, a data type (more specifically, a sequence type) that includes anything enclosed in quotation marks (letters, numbers, spaces, and symbols) ○ Numbers will NOT be read as numbers - they have NO mathematical value ○ Examples: The string 'Hello' consists of the characters 'H', 'e', 'l', 'l', and 'o'. The string '123' consists of the characters '1', '2', and '3'. ○ Can use single, double, or triple quotes but… using single quotes for shorter strings and double quotes for longer or more complicated text that contains quotes is a good practice Examples print(‘Hello world!’) print(“I cannot say ‘hello world’ again!”) ○ String: Basically the variable name that is holding the string literal (sometimes used interchangeably as the variable itself or data type) ○ String Literal: The part inside the quotation marks (refers to the “” content a variable holds) LITERALLY the string ○ The characters inside are ordered left to right, and each one’s position is its index ○ To check the length (how many characters) are in a string, see len() python pedia ○ See escape sequence for ignoring a quotation mark in a sentence ○ See f-strings ○ String / Stri: ○ String Concatenation: ○ Adding more characters onto an original string using a + ○ Strings are immutable (you cannot change individual characters in a string) ○ To make changes to what exist in that space, you must make an assignment statement to update an entire string variable ○ You may add to the end of string by using concatenation, which doesn’t contradict the immutability because the result is a new string, leaving the old unchanged ○ ○ Storage: ○ Keeps/stores files and other data (like programs, songs, movies, documents, etc.) ○ May be volatile or non-volatile ○ Usually a disk or flash Sunset: ○ To plan to remove or discontinue something in IT; end-of-life Switch:Bookmark ○ Switches control whether or not electricity flows through a wire (on and off) ○ Switches can be controlled electronically ○ In an electronically controlled switch, a positive voltage at the control input allows electricity to flow, while a zero voltage prevents the flow ○ A positive voltage is seen as a "1" and a zero voltage as a "0" Syntax: ○ The programming language’s rules on how symbols can be combined to make a program Syntax Error: ○ A syntax error means that it violated syntax rules ○ A common error is to use = rather than == in an if-else expression, as in: if numDogs = 9:. In such cases, the interpreter should generate a syntax error T Terabyte: ○ A trillion bytes Transistor: ○ Smaller switches created when computers were as large as rooms Type: ○ See Data Type U Unary: ○ A unary minus sign is used to make a number negative ○ Part of the precedence rules ○ “You-nair-ee” (video) Unicode (or The Unicode Standard): ○ A system for text encoding that represents every possible character with unique numbers (over 1 million) that are known as code points ○ Designed to support the use of text written in all of the world's major writing systems (version of letters) ○ They exist for visible characters and special characters (example, the newline character, which is two items, but not read as such) ○ Python’s official how-to with Unicode ○ Click for all charts ○ Click to check Unicode text values in zyBooks (2.11.3) V Value: ○ Object: The data associated with the object, such as the number 4, ‘efadfg’, or mom ○ Dictionary: Describes some data (any data type) associated with a key (like the definition) Variable: ○ A label for data (like a box when you’re moving ACTUALLY NOT, READ THIS) ○ A named reference ○ Uses an equal sign to assign the label ○ Example: name = miss_haan Volatile: ○ Loses its contents when powered off; opposite of non-volatile W Whitespace: ○ Indentations (usually tab or 4 spaces), a new line, or a space ○ Can be required or optional ○ Often used to show the boundaries areas of code, or to show the relationship from one line to the other (like parent/child) ○ Don't let 1 line of code go past 80-120 characters/spaces (aka columns) - but 80 is the more widely accepted standard. If it must wrap to the next line, it should start and end in parentheses, and each line should start at the same “level” (number of spaces) as the beginning of the extending line (it is not considered a block, so do not have to be at intervals of 4) X Y Z - i/VISUAL AIDS CODING AI HELP Tips ○ Make accounts using your school email, but NOT google login ○ Specify using Python 3 ○ Ask to explain at a “-” grade level ○ Ask if there’s another way to do it ○ Ask to explain certain words ○ Ask to use certain keywords/concepts (or not use) ○ If you/it gets confused, restart Replit AI ChatGPT X Codium ○ Extension, so must use in-browser options ○ Create an account, but not with google sign-in ○ Chat in browser ○ Try the playground Replit AI ○ Auto-complete some code ○ num_rows = int(input("Enter the number of rows: ")) ○ num_cols = int(input("Enter the number of columns: ")) ○ for curr_row in range(1, num_rows + 1): ○ curr_col_let = 'A' ○ for i in range(num_cols): ○ print(str(curr_row) + curr_col_let, end=' ') ○ curr_col_let = chr(ord(curr_col_let) + 1) ○ print() ○ ```col_let = chr(ord(curr_col_let) + 1) ○ print() AP TEST About the exam 2 parts ○ Create performance task (several weeks, ending April 30) ○ End-of-course exam (May 15) Score is scale of 1-5 (need at least a 3, but it depends on the school) Performance task (30% of score) ○ We will do 3 things over this time Write a program Take a video of your program (by yourself) Create a Personalized Project Reference Sheet, or PPR (by yourself) ○ Given 9 hours class time minimum (broken up over several days) ○ CAN work more than 9 hours, and/or from home ○ CAN use AI to help, BUT have to say when/where got help from AI ○ NO teacher help ○ CAN have a partner End-of-course exam (70% of score) ○ 120 minutes multiple choice + 60 minutes free response ○ Multiple Choice 57 single-select multiple-choice 5 single-select with reading passage about a computing innovation 8 multiple-select multiple-choice: select 2 answers ○ Written/Free Response Free response questions about your program using your PPR 2 questions (multiple parts, possibly 4 prompts) To see exact prompts, scroll to “Exam Components”, click “Section II: Create Performance Task”, and they have all the Written Response Prompts ○ If you’re done early, you do NOT get to leave early ○ If you skip the test, you have to pay the school for it ○ What to bring on exam day Exam reference sheet ○ AP test doesn’t use Python or any certain coding language ○ Annotate (make notes) and figure out what they’re saying ○ This sheet will be available during exam Student Guidelines for Create Performance Task (Fall 2023)

Use Quizgecko on...
Browser
Browser