PLTW Computer Science Principles - Unit 1

Algorithm
Click the card to flip 👆
1 / 93
Terms in this set (93)
Counter VariableA variable that counts in an arithmetic sequence, usually counting by ones starting at 0 or 1. Can count up or down.AbstractionCreating simple concise representations of more complex phenomena so that people can more easily work with, communicate about, and learn about anything.ConcatenationAttaching two things side-by-side, frequently strings of text and variables. Separated by a comma in Python.Assignment OperatorThe '=' character causes the compiler or interpreter to evaluate to the expression on its right and store the result in the variable(s) on its left.Block of CodeA group of program statements that are grouped together, denoted by indentation in Python. Used often inside of while or for loops in their indentation.EvaluateTo determine the result of an expression, like the condition of a while loop.Flow ChartA graphic organizer that can be used to show the procedural pathways within a program.ImportIn Python ____________ is a key word for using one module of code from inside another module.IntA native type representing the integers, which are positive whole numbers and their opposites. Can convert someone's input to an number to store in a variable.LoopAlgorithmic structure for performing the instructions multiple times, with each pass through the loop called an iteration. Usually controlled by a condition evaluated with each iteration.StringA type of data in Python that is comprised of text characters inside of quotation marks. If you put this inside a print method, it will print out exactly what you have between the quotation marks and won't change in your program.SyntaxThe grammar of a programming language, defining what specific sequences of characters are allowed, what they mean, and how they can be put together.Working DirectoryThe directory/folder in the file system you are currently "in" in REPL.IT. Used as the "dir" command to show the files you have.ParameterThe values that the programmer provides in the method call. For example, t. forward(25)Function nameA unique identifier given to the function when it is defined and used again whenever the function is called.GUIA Graphical User Interface, currently the dominant method for designing human-computer interaction. You used this with your robot maze activities when you used images.MethodInstructions executed for a particular object.ModuleAn encapsulated collection of one or more related classes, each with its own methods and attributes. Turtle and Time are two examples.Multi-line comment or Block StringDenoted by ''',these can generate docstrings and allow the programmer to leave notes in code that span several lines without having to type '#' at the beginning of each line.PixelShort for picture element; it is a single dot of color.cd commandChanges the current directory/folder you are working in.natural languagePseudocodea high-level description of the actions of a program or algorithm, using a mixture of natural language and informal programming language syntaxprogramming languageProvides the standards, syntax, statements, and instructions for writing computer software.Turtle ModuleBuilt in the Python programming language that allows coders to create graphics. Can be imported into a regular python program.turtle nameA variable you can give to the turtle in order to use the turtle along with its various methods in a program.importTo bring in code from another module in python..goto()The turtle method used to go to a different x and y positioninput methodA method used to allow a user to type in an answer to a question and then store that answer as a variable.Python terminalThe window that displays textual output generated by Python's print statement. The terminal also allows the user to type commands that are immediately executed upon pressing the Enter key.VariableA placeholder for information that can be stored in memory throughout a program.data typeAll values in a programming language have a "type" - such as a Number, Boolean, or String - that dictates how the computer will interpret it. For example 7+5 is interpreted differently from "7"+"5".fillcolor()The turtle method used to fill in a drawn object. Used along with begin_fill() and end_fill()for loopLoops that have a predetermined beginning, end, and increment (step interval). Used if you know a certain amount of times you want something repeated.incrementAn amount you step a variable up or down by.range()A method used to declare a certain starting point and ending point for a range of numbers.modulo operator%moduloa mathematical operation that returns the remainder after integer division. Example: 7 MOD 4 = 3==equal to in programming>Greater than<Less than>=greater than or equal to<=less than or equal to!=Not equal toBoolean ValueA value that can either be true or false.conditional expressionA comparison, usually in a while or if statement, that evaluates to a Boolean value of True or Falsewhile loopa programming construct used to repeat a set of commands (loop) as long as (while) a boolean condition is trueZero-iteration loopa loop that never startsinfinite loopa loop that never endsPEMDASParentheses, Exponents, Multiplication, Division, Addition, Subtractionmainloop( ) methodMakes the turtle window repeat on the screen and stay up.Method dotNotated by a period character Allows a method to be attached to a variable, most often the Turtle()nested loopA loop inside the body of another loop.FunctionA programming construct that allows us to define and call code that we create. There re also pre-defined functions in Python we can use already too.function definitionThe place where you assign a series of actions to one easy to remember name. You can't use the function here.function calla command that executes the code within a functionFROM keywordUsed to tell a python file which folder and which file to import code in from.zipped folderA folder that has been reduced in size and thus takes up less storage space and can be transferred to other computers quickly; also called a compressed folder.Folder ExtractionTaking files from a zipped folder and being able to use and upload them to REPL.ITPython ListAn extended variable that can house multiple values such as integers, strings, and true/false values (booleans)len()Returns the number of character indexes in a text stringlist indexA common method for referencing the position of elements in a list or string using natural numbers. In Python, the index of the first element is 0, not 1.append methodadds an item to the end of a listInsert methodinserts characters anywhere in a string; its syntax is string.Insert(startIndex, value)pop methodremoves an element at a given positionlist traversalThe sequential accessing of each index in a list.for loop traversalTraversing a string means accessing each character in the string, one at a time. for i in color_list:conditional statementa statement that can be written in if-then formThe if statement: Python syntaxif (condition in here): statement statementnested if statementThis is an if statement that appears inside another if statement.conditionThe portion of an if statement or while loop that evaluates to true if the condition is met.elif statementStatements that can be indefinitely added to an if-else statement to allow it to make additional decisions.Programming events"Actions" a user can take like a key press or a mouse click that makes something happen in a program. FOr example: t.onclick(function_name)KeyPress eventoccurs each time the user presses a key to "call" a function to run because that event was triggered.random moduleincludes library functions for working with random numbersrandint functiongenerates a random number in the range provided by the arguments, such as between 0 and 10Write() methodDisplays a line of Text output on the screen, not the console.clear methoddeletes all items on a screen, including the turtles.turtle.Screen()Creates a screen for a turtle to use and present different actions onto.return valuesAny value that a method or function gives back to the statement command from which the function or method is called.text documentA separate file that can contain text and other information. Can be called upon in your program to display information. Example would have been the leaderboard in your cat-a-turtle game.GIF imagesBest images to use in pythonListen MethodHelps to "listen" for an event such as a keypress. When the keypress is triggered, the listen method will help run the code associated with the keypress