



















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A comprehensive vocabulary list for the python entry-level programmer certification (pcep) exam. It includes definitions of key programming terms, data types, operators, and concepts essential for understanding python. This resource is designed to help students and aspiring programmers grasp the fundamental terminology required for the pcep exam and build a solid foundation in python programming. It covers topics such as data types, operators, control flow, and basic syntax, offering clear explanations and examples to aid comprehension and retention. This vocabulary list serves as a valuable reference for anyone preparing for the pcep exam or seeking to enhance their understanding of python programming concepts.
Typology: Exams
1 / 27
This page cannot be seen from the preview
Don't miss anything!




















programming language - Correct Answer-a language developed by humans and used to communicate with computers. This language has a set of means to instruct a pc what to do and how High level programming language - Correct Answer-programming language which operates on high level of abstraction thereby allowing developer to ignore the physical details of the pc hardware, for ex. the cpu type, memory size and organization, etc. (python,javascript,c/c++ are ex of high-level languages) machine language - Correct Answer-language placed at the lowest level of programming. sequence of bits(0s and 1s) which forces the CPU to execute the desired elementary operations instruction list - Correct Answer-IL, a list of all elementary(atomic) operations which can be executed by a certain cpu. For EX, x86(used in personal pc) and arm(used in mobile devices) processors have different and incompatible instruction lists source code - Correct Answer-text encoded in any programming language. Source code is usually put inside a text file which resides inside the developers pc filesystem, while the file name's extension reveals the programming language used to write the code. for python we use .py language is constituted by: - Correct Answer-an alphabet: understood as a set of symbols used to build words of a certain language. a Lexis: also known as dictionary, set of words the language offers its users
syntax: set of rules used to determineif a cetain sequence of words forms a valid sentence. semantics: defined as a set of rules which settles whether or not a certain phrase or sentence makes sense in a given language. ________cannot be directly executed by a pc - Correct Answer-Source code. To make this possible, the source code has to be translated into machine code accepted by a target pc and its cpu. This can be done using compilation or interpretation compilation - Correct Answer-performed by a one-time translation of the source program; an executable binary file is created in effect, the file can be run at any time without needing the source code, the program that performs the above translation is called compiler or translator -designed to translate a program written in high-level prg language into binary code deployed inside an executable file interpretation - Correct Answer-involves a dedicated program designed to translate the source program on the fly each time it has to run, the program performing that task is called an interpreter, which means the interpreter is needed whenever the source code has to be executed.
0o or 0O means its an octal value(contains only octal digits) 0x or 0X, is hexadecimal, 0X11 = 17 0b or 0B is a binary num- which contains 0s and 1s ony floating point - Correct Answer-A type that represents numbers with fractional parts. decimal points can contain a dot (.) or the letter e for scientific notation Here are some examples of correct float literals: 1.1 - one and one-tenth 1.0 (1. for short) - one point zero 0.1 (.1 for short) - one-tenth 1E1 - ten point zero 1e-1 - one-tenth -1.1E-1 - minus eleven hundredths 1e1 = 10.0 cus 1 * 10^1 = 10
Operators and data types - Correct Answer-numeric operators: **, *, /, %, //, +, -, string operators: *, +, assignments and shortcut operators, unary and binary operators, priorities and binding, bitwise operators: ~, &, ^, |, <<, >>, Boolean operators: not, and, or, Boolean expressions, relational operators (==, !=, >, >=, <, <=), the accuracy of floating-point numbers, type casting. input/output console operations - Correct Answer-functions: print(), input(), sep = and end = keyword paramters, functions: int() and float() string - Correct Answer-_____literals are sequences (including empty ones) of characters (digits, letters, punctuation marks, etc.). There are two kinds of string literal: single-line string literals - Correct Answer-_____, is when the string itself begins and ends in the same line of code: these literals are enclosed in a pair of ' (apostrophe) or " (quote) marks. multi-line string - Correct Answer-_____ is when the string may extend to more than one line of code: these literals are enclosed in a pair of trigraphs either """ or ''' strings enclosed inside apostrophes can contain quotes, and vice versa.
"""Two lines""" Boolean literals - Correct Answer-denote the only two possible values used by the Boolean algebra - their only acceptable denotations are True and False None - Correct Answer-The ____ literal denotes an empty value and can be used to indicate that a certain item contains no usable value. operator - Correct Answer-An ________ is a symbol that determines an operation to perform. The ______along with its arguments (operands) forms an expression that is subject to evaluation and provides a result. 3 basic groups of operators in python - Correct Answer-arithmetic, whose arguments are numbers; string, which operates on strings or strings and numbers; Boolean, which expects that their arguments are Boolean values. unary operator - Correct Answer-_____ is an operator with only one operand. binary operator - Correct Answer-_____ is an operator that has two operands Unary Arithmetic Operators - Correct Answer-the - operator: Change argument's sign-(-2) is equal to 2
the + operator: Preserve argument's sign +(-2) is equal to - Operator symbols - Correct Answer-** - exponentiation result type - int if both are ints, float otherwise
priority - middle, operator: +, Name: Concatenation, ex: 'a' + 'z' = 'az' 'z' + 'a' = 'za' Boolean Operators - Correct Answer-not, and, or highest, middle, lowest priority Boolean operators demand Boolean arguments, and always result in a Boolean result. The rules governing the use of operators and parentheses remain the same, including left-sided binding. not - not false = true not true = false and- true and false = false true and true = true or - false or false - false false or true - true true or false - true true or true - true
Relational Operators - Correct Answer-Relational operators compare their arguments to diagnose the relationship between them, and always return a Boolean value indicating the comparison result. == equal to 2 == 1 False !=not equal to 2 != 1True >greater than2 > 1True >=greater or equal 2 >= 1 True 1 >= 1, True < less than 2 < 1 False <= less or equal 2 <= 1 False 1 <= 1, True Variable - Correct Answer-A ____ is a named container able to store data. A variable's name can consist of: letters (including non-Latin ones)digits underscores (_)and must start with a letter (note: underscores count as letters). Upper- and lower-case letters are treated as different. Variable names which start with underscores play a specific role in Python - don't use them unless you know what you're doing. Variable names are not limited in length. python keywords/reserved words - Correct Answer-Protected, special words (in some cases, tells Python you are about to define a function)
Comments - Correct Answer-A part of the code line which starts with hash (#), which is not a part of a string literal, is considered a comment (a part of the code which is ignored by the interpreter) For example, these two lines contain comments:
result = True # only part of this line is a comment if statement - Correct Answer-The conditional statement (the ___statement) is a means allowing the programmer to branch the execution path and to execute (or not) selected instructions when a certain condition is met (or not) if condition: instructions pass keyword - Correct Answer-pass keyword can be used to indicate that no action should be performed in the specific context. As the if instruction syntax insists that there should be at least one statement after it, the following snippet does not affect program execution: if condition: pass
while loop - Correct Answer-The____ loop statement is a means allowing the programmer to repeat the execution of the selected part of the code as long the specified condition is true. The condition is checked before the loop's first turn, and therefore the loop's body may not even be executed once. The basic form of the while statement looks as follows:while condition: instructions for loop - Correct Answer-The ____ loop statement is a means allowing the programmer to repeat the execution of the selected part of the code when the number of repetitions can be determined in advance. The for statement uses a dedicated variable called a control variable, whose subsequent values reflect the status of the iteration for control_variable in range(from, to, step): instructions range() function - Correct Answer-The range() function is a generator responsible for the creation of a series of values starting from keyword from and ending before reaching to, incrementing the current value by step. The invocation range(i, j) is the equivalent of range(i, j, 1) The invocation range(i) is the equivalent of range(0, i) For example, the following snippet prints 0,1,2, to the screen: for i in range(3): print(i, end=',')
print(i, end=' ') else: print('FINISHED')
i = 1 while True: print(i, end=' ') i += 1 if i == 3: break else: print('FINISHED') continue - Correct Answer-The continue statement can be used inside the loop's body only, and causes an immediate transition to the next iteration of the for loop, or to the while loop's condition check. For example, these two snippets print 0 2 FINISHED to the screen:
for i in range(4): if i % 2 == 1: continue print(i, end=' ')
else: print('FINISHED')
i = - while i < 3: i += 1 if i % 2 != 0: continue print(i, end=' ') else: print('FINISHED') list - Correct Answer-A list is a data aggregate that contains a certain number (including zero) of elements of any type. Lists are sequences - they can be iterated, and the order of the elements is established. Lists are mutable - their contents may be changed. Lists can be initialized with list literals. For example, these two assignments instantiate two lists - the former is empty, while the latter contains three elements: empty_list = [] three_elements = [1, 'two', False]
IndexError - Correct Answer-This will happen if you try to use an index that is out of range for a list. slice - Correct Answer-a means by which the programmer can create a new list using a part of the already existing list. The most general slice looks as follows: the_list[from:to:step] and selects those elements whose indices start at from, don't exceed to, and change with step. The following assumptions are made regarding the slices: the_list[from:to] is equivalent to the_list[from:to:1] the_list[:to] is equivalent to the_list[0:to] the_list[from:] is equivalent to the_list[from:len(the_list)-1] the_list[:] is equivalent to the_list[0:len(the_list)-1] Slices - like indices - can take negative values. For example, the following snippet prints [1,2] to the screen: the_list = [0, 1, 2, 3] print(the_list[-3:-1])
.append() - Correct Answer-The .append(element) method can be used to append an element to the end of an existing list. For example, the following snippet outputs [1] to the screen: the_list = [] the_list.append(1) print(the_list) .insert() - Correct Answer-The .insert(at_index, element) method can be used to insert the element at the at_index of the existing list. For example, the following snippet outputs [2, 1] to the screen: the_list = [1] the_list.insert(0, 2) print(the_list) del keyword - Correct Answer-The del the_list[index] instruction can be used to remove any of the existing list elements. For example, the following snippet prints [] to the screen: the_list = [1] del the_list[0] print(the_list) in and not in operators - Correct Answer-The in and not in operators can check whether any value is contained inside the list or not.