Python Programming Terms, Exams of Computer Science

Python Programming Terms Python Programming Terms

Typology: Exams

2025/2026

Available from 03/25/2026

emilly-martin
emilly-martin šŸ‡ŗšŸ‡ø

4.3

(3)

2.9K documents

1 / 54

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Python Programming Terms|
algorithm - Answer-A set of specific steps for solving a category of
problems
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
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36

Partial preview of the text

Download Python Programming Terms and more Exams Computer Science in PDF only on Docsity!

Python Programming Terms|

algorithm - Answer -A set of specific steps for solving a category of problems 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 - Answer -The order in which statements are executed during a program run. function - Answer -A named sequence of statements that performs some useful operation. Functions may or may not take parameters and may or may not produce a result fruitful function - Answer -A function that returns a value when it is called. local variable - Answer -A variable defined inside a function. A local variable can only be used inside its function. Parameters of a function are also a special kind of local variable. parameter - Answer -A name used inside a function to refer to the value which was passed to it as an argument. boolean function - Answer -A function that returns a Boolean value. The only possible values of the bool type are False and True. 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.

compound data type - Answer -A data type that is itself made up of elements that are themselves values. decrement - Answer -To subtract one from a variable. dictionary - Answer -A collection of key/value pairs that maps from keys to values. exception - Answer -Raised by the runtime system if something goes wrong while the program is running. file - Answer -A named entity, usually stored on a hard drive, floppy disk, or CD-ROM, that contains a stream of characters. format operator - 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 - Answer -When a boolean expression is evaluated the evaluation starts at the left hand expression and proceeds to the right, stopping when it is no longer necessary to evaluate any further to determine the final outcome. slice - Answer -A copy of part of a sequence specified by a series of indices. traverse - Answer -To repeat an operation on all members of a set from the start to the end. argument - Answer -a value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function. integer division - Answer -An operation that divides one integer by another and yields an integer. Integer division yields only the whole number of

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 The first input operation is called the _____, and its purpose is to get the first input value that will be tested by the validation loop. - Answer -Priming read What is the structure that causes a statement or a set of statements to execute repeatedly? - Answer -Repetition When will the following loop terminate? while keep_on_going != 999 : - Answer -When keep_on_going refers to a value not equal to 999 In Python, a comma-separated sequence of data items that are enclosed in a set of brackets is called a _____. - Answer -list In Python, the variable in the for clause is referred to as the _____ because it is the target of an assignment at the beginning of each loop iteration. - Answer -Target Variable Which of the following represents an example to calculate the sum of the numbers (accumulator)? - Answer -total += number

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

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 - 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: All programs are normally stored in ROM and loaded into RAM as needed for processing. - Answer -False True/False: The instruction set for a microprocessor is unique and is typically understood only by the microprocessors of the same brand. - Answer -True

True/False: The CPU understands instructions written in a binary machine language. - Answer -True True/False: The main reason for using secondary storage is to hold data for long periods of time, even when the power supply to the computer is turned off. - Answer -True True/False: RAM is a volatile memory used for temporary storage while a program is running. - Answer -True 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

After the execution of the following statement, the variable sold will reference the numeric literal value as a(n) _____ data type: sold = 256.

  • Answer -float After the execution of the following statement, the variable price will reference the value _____. price = int(68.549) - Answer - The output of the following print statement is: print 'I'm ready to begin' - Answer -I'm ready to begin If value1 is 2.0 and value2 is 12, what is the output of the following command? print(value1 * value2) - Answer -24. The _____ built-in function is used to read a number that has been typed on the keyboard. - Answer -input() What is the output of the following print statement? print('The path is D:\sample\test.') - Answer -The path is D:\sample\test What symbol is used to mark the beginning and end of a string? - Answer - Quotation True/False: According to the behavior of integer division, when an integer is divided by an integer, the result will be a float. - Answer -False True/False: Python allows programmers to break a statement into multiple lines. - Answer -True True/False: Python formats all floating-point numbers to two decimal places when outputting using the print statement. - Answer -False

True/False: Computer programs typically perform three steps: Input is received, some process is performed on the input, and output is produced.

  • Answer -True True/False: In Python, print statements written on separate lines do not necessarily output on separate lines. - Answer -True True/False: The \t escape character causes the output to skip over to the next horizontal tab. - Answer -True The % symbol is the remainder operator and it is also known as the _______________ operator. - Answer -modulus A(n) _______________ character is a special character that is preceded with a backslash, appearing inside a string literal. - Answer -escape The _______________ specifier is a special set of characters that specify how a value should be formatted. - Answer -formatting When applying the .3f formatting specifier to the following number, 76.15854, the result is _______________. - Answer -76. A(n) _______________ is a name that represents a value stored in the computer's memory. - Answer -variable Python uses _______________ to categorize values in memory. - Answer - data types When the + operator is used with two strings, it performs string _______________. - Answer -Concatenation A(n) _____ structure is a logical design that controls the order in which a set of statements execute. - Answer -control

True/False: Expressions that are tested by the if statement are called Boolean expressions. - Answer -True True/False: Decision structures are also known as selection structures. - Answer -True True/False: An action in a single alternative decision structure is performed only when the condition is true. - Answer -True The _______________ statement is used to create a decision structure. - Answer -If In flowcharting, the _______________ symbol is used to represent a Boolean expression. - Answer -diamond A(n) _______________ decision structure provides only one alternative path of execution. - Answer -single alternative In a decision structure, the action is _______________ executed because it is performed only when a certain condition is true. - Answer -conditionally A(n) _______________ operator determines whether a specific relationship exists between two values. - Answer -relational A(n) _______________ statement will execute one block of statements if its condition is true, or another block if its condition is false. - Answer -if/else Python provides a special version of a decision structure known as the _______________ statement, which makes the logic of the nested decision structure simpler to write - Answer -if elif else

The logical _______________ operator reverses the truth of a Boolean expression. - Answer -not Boolean variables are commonly used as _______________ to indicate whether a specific condition exists. - Answer -flags A(n) _______________ expression is made up of two or more Boolean expressions. - Answer -compound variable - Answer -stores a piece of data and gives it a specific name boolean - Answer -a data type that is like a light switch. it can only have two values: true, false modulo - Answer -%. Returns the remainder from a division. data types - Answer -i.e. numbers and booleans whitespace - Answer -separates statements exponent - Answer -** variables can be reassigned? - Answer -True string - Answer -can contain letters, numbers, and symbols \ - Answer -tells Python not to end the string index - Answer -the number that each character in a string is assigned string methods - Answer -let you perform specific tasks on strings

my_list.sort() - Answer -sorts a list from lowest to highest, or alphabetical len(my_list) - Answer -finds the length of a list len[2] = 3 - Answer -The 2nd term of the list is now equal to 3 my_list.insert(4, "cat") - Answer -Inserts the string "cat" at the 4th position in a list my_list[:] - Answer -gives you the entire list my_list[0:] - Answer -gives you the whole list, starting at the 0 position my_list[1:3] - Answer -gives you the list starting at the 1st position and ending at the 2nd position my_list[-1] - Answer -gives you the last term in the list %r is used for... - Answer -debugging and display %s is used for - Answer -display optparse first command - Answer -import optparse parser = optparse.OptionParser adding parser options - Answer -parser.add_option('-n, '--new') after we've added options (in parser) - Answer -(options, args) = parser.parse_args() github steps - Answer -1. git status

  1. git add (adds to staging)
  1. git commit -m "What you've done"
  2. git push -u origin master raw_input() - Answer -Raw input prompts the user for an input and then turns that input into a string. In between "(" and ")" the programmer writes the prompt that will prompt the user. When you set raw_input() equal to a variable, that variable becomes what the user inputs. What is sys.argv? - Answer -It allows you to input parameters from the command line. Control flow statements - Answer -if, for, while Order of Conditionals - Answer -1. not
  3. and
  4. or What's a dictionary? - Answer -A list of tuples in curly brackets: {"x:y"}; x is a key, y is a value; dictionaries are unordered. == - Answer -means equal to != - Answer -means doesn't equal <, <=, >, >= - Answer -less than, less than or equal to, greater than, greater than or equal to and - Answer -means that both conditions must be true or - Answer -means one of the conditions must be true not - Answer -gives the opposite of the statement; i.e. "Not True is False"