



























































































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!




























































































●● token Answer: basic elements of a language(letters, numbers, symbols) ●● high-level language Answer: A programming language like Python that is designed to be easy for humans to read and write. ●● low-level langauge Answer: A programming language that is designed to be easy for a computer to execute; also called machine language or assembly language ●● keyword Answer: define the language's syntax rules and structure, and they cannot be used as variable names ●● statement Answer: instruction that the Python interpreter can execute
●● operators Answer: special tokens that represent computations like addition, multiplication and division ●● modulus operator Answer: %, works on integers (and integer expressions) and gives the remainder when the first number is divided by the second ●● evaluate Answer: To simplify an expression by performing the operations in order to yield a single value. ●● int Answer: A Python data type that holds positive and negative whole numbers ●● float Answer: A Python data type which stores floating-point numbers. Floating-point numbers are stored internally in two parts: a base and an exponent. When printed in the standard format, they look like decimal numbers ●● flow of execution
●● None Answer: A special Python value. One use in Python is that it is returned by functions that do not execute a return statement with a return argument. ●● block Answer: A group of consecutive statements with the same indentation. ●● boolean expression Answer: An expression that is either true or false. ●● conditional statement Answer: A statement that controls the flow of execution depending on some condition. In Python the keywords if, elif, and else are used for conditional statements. ●● conditional statement Answer: One program structure within another, such as a conditional statement inside a branch of another conditional statement ●● type conversion Answer: An explicit function call that takes a value of one type and computes a corresponding value of another type.
●● definite iteration Answer: A loop where we have an upper bound on the number of times the body will be executed. Definite iteration is usually best coded as a for loop ●● increment Answer: Both as a noun and as a verb, increment means to increase by 1. ●● iteration Answer: Repeated execution of a set of programming statements. ●● nested loop Answer: A loop inside the body of another loop. ●● trace Answer: To follow the flow of execution of a program by hand, recording the change of state of the variables and any output produced. ●● aliases Answer: Multiple variables that contain references to the same object. ●● clone
Answer: The % operator takes a format string and a tuple of values and generates a string by inserting the data values into the format string at the appropriate locations. ●● global variable Answer: Can be seen through a program module, even inside of functions. ●● immutable type Answer: A compound data type whose elements can NOT be assigned new values. ●● iteration Answer: To repeat a section of code. ●● mutable type Answer: A compound data type whose elements can be assigned new values. ●● nested list Answer: A list that is itself contained within a list. ●● operator
Answer: A special symbol that represents a simple computation like addition, multiplication, or string concatenation. ●● pixel Answer: Smallest addressable element of a picture. ●● proprioception Answer: on a robot, internal sensing mechanisms. On a human, a sense of the relative positions of different parts of ones own body. ●● recursion Answer: The process of calling the currently executing function. ●● robot Answer: mechanism or an artificial entity that can be guided by automatic controls. ●● sequence Answer: A data type that is made up of elements organized linearly, with each element accessed by an integer index. ●● short circuit evaluation
●● lambda Answer: A piece of code which can be executed as if it were a function but without a name. (It is also a keyword used to create such an anonymous function.) ●● module Answer: A file containing definitions and statements intended to be imported by other programs. ●● What is the disadvantage of coding in one long sequence structure? Answer: If parts of the duplicated code have to be corrected, the correction has to be made many times. ●● What type of loop structure repeats the code a specific number of times Answer: Count-controlled loop ●● What type of loop structure repeats the code based on the value of the Boolean expression Answer: Condition-controlled loop ●● What is the format for the while clause in Python
Answer: while condition : statement ●● What are the values that the variable num contains through the iterations of the following for loop? for num in range(2, 9, 2) Answer: 2, 4, 6, 8 ●● What are the values that the variable num contains through the iterations of the following for loop? for num in range(4) Answer: 0, 1, 2, 3 ●● The variable used to keep the running total Answer: Accumulator ●● What is not an example of an augmented assignment operator Answer: <= ●● _____ is the process of inspecting data that has been input to a program to make sure it is valid before it is used in a computation. Answer: Input validation
●● True/False: A better way to repeatedly perform an operation is to write the statements for the task once, and then place the statements in a loop that will repeat the statements as many times as necessary. Answer: True ●● True/False: In flowcharting, the decision structure and the repetition structure both use the diamond symbol to represent the condition that is tested. Answer: True ●● True/False: The first line in the while loop is referred to as the condition clause. Answer: True ●● True/False: In Python, an infinite loop usually occurs when the computer accesses the wrong memory address. Answer: False ●● True/False: Both of the following for clauses would generate the same number of loop iterations: for num in range(4): for num in range(1,5): Answer: False
●● True/False: The integrity of a program's output is only as good as the integrity of its input. For this reason the program should discard input that is invalid and prompt the user to enter correct data. Answer: True ●● True/False: In a nested loop, the inner loop goes through all of its iterations for every single iteration of an outer loop. Answer: True ●● True/False: To get the total number of iterations of a nested loop, multiply the number of iterations of all the loops. Answer: True ●● A(n) ?? structure causes a statement or set of statements to execute repeatedly. Answer: Repetition ●● A(n) ??-controlled loop causes a statement or set of statements to repeat as long as a condition is true. Answer: Condition ●● The while loop is known as a(n) ?? loop because it tests conditions before performing an iteration.
Answer: Range ●● Which of the following is not a microprocessor manufacturing company? Answer: Dell ●● Which computer language uses short words known as mnemonics for writing programs? Answer: Assembly ●● The process known as the _____ cycle is used by the CPU to execute instructions in a program. Answer: fetch-decode-execute ●● The following is an example of an instruction written in which computer language? 10110000 Answer: Machine language ●● What is the encoding technique called that is used to store negative numbers in the computer's memory? Answer: two's complement ●● The _____ coding scheme contains a set of 128 numeric codes that are used to represent characters in the computer memory.
Answer: ASCII ●● What is the largest value that can be stored in one byte? Answer: 255 ●● The smallest storage location in a computer's memory Answer: bit ●● The disk drive is a secondary storage device that stores data by _____ encoding it onto a spinning circular disk. Answer: magnetically ●● A _____ has no moving parts, and operates faster than a traditional disk drive. Answer: solid state drive ●● True/False: A computer is a single device that performs different types of tasks for its users. Answer: False ●● True/False: The CPU is able to quickly access data stored at any random location in ROM. Answer: False
●● True/False: The Python language uses a compiler, which is a program that both translates and executes the instructions in a high level language. Answer: False ●● A(n) _______________ is a set of instructions that a computer follows to perform a task. Answer: program ●● The term _______________ refers to all of the physical devices that a computer is made of. Answer: hardware ●● The _______________ is the part of a computer that actually runs programs and is the most important component in a computer. Answer: cpu ●● _______________ are small central processing unit chips. Answer: micro processors ●● Main memory is commonly known as _______________. Answer: RAM
●● _______________ is a type of memory that can hold data for long periods of time, even when there is no power to the computer. Answer: secondary storage ●● A disk drive stores data by _______________ encoding it onto a circular disk. Answer: magnetically ●● The Python _______________ is a program that can read Python programming statements and execute them. Answer: interpreter ●● In _______________ mode, the interpreter reads the contents of a file that contains Python statements and executes each statement. Answer: script ●● What type of error produces incorrect results but does not prevent the program from running? Answer: logic ●● The program development cycle is made up of _____ steps that are repeated until no errors can be found in the program. Answer: 3