Docsity

PCEP Certified Entry-Level Python Programmer Exam: Questions and Answers, Exams of Advanced Education

Toggle sidebar
bg1
Python Programmer Certification
PCEP Certified Entry-Level Exam
Questions & Answers
*Python is an interpreted Language
Interpreter - ANSWERS-An interpreter is a program that reads and executes
code
-An interpreter will:
1. Check if all subsequent lines are correct
2. if an error is found d the interpreter stops and an error message is made.
3. the interpreter lets you know where the error is located and what caused
it.
4. If the line is good the interpreter tries to execute it.
*Each line is usually executed separately.
Compilation - ANSWERS-The source program is translated once (however,
this act must be repeated each time you modify the source code) by getting
a file (e.g. an .exe if the code is intended to be run under windows)
containing the machine code; now you can distribute the file worldwide.
Compiler - ANSWERS-The program that performs the translation is called a
compiler or translator.
Python keywords - ANSWERS-Keywords are the reserved words in Python
pf3
pf4
pf5
pf8

Partial preview of the text

Download PCEP Certified Entry-Level Python Programmer Exam: Questions and Answers and more Exams Advanced Education in PDF only on Docsity!

Python Programmer Certification

PCEP Certified Entry-Level Exam

Questions & Answers

*Python is an interpreted Language Interpreter - ANSWERS-An interpreter is a program that reads and executes code -An interpreter will:

  1. Check if all subsequent lines are correct
  2. if an error is found d the interpreter stops and an error message is made.
  3. the interpreter lets you know where the error is located and what caused it.
  4. If the line is good the interpreter tries to execute it. *Each line is usually executed separately. Compilation - ANSWERS-The source program is translated once (however, this act must be repeated each time you modify the source code) by getting a file (e.g. an .exe if the code is intended to be run under windows) containing the machine code; now you can distribute the file worldwide. Compiler - ANSWERS-The program that performs the translation is called a compiler or translator. Python keywords - ANSWERS-Keywords are the reserved words in Python

*True, False, is, if, in, elif, etc. Indenting - ANSWERS-Leading white-space (spaces or tabs) at the beginning of a logical line is used to compute the indentation level of the line, which in turn is used to determine the grouping of statements. Literals - ANSWERS-A literal is data whose values are determined by the literal itself. *[123] is a literal, and [C] is not. Boolean - ANSWERS-A Boolean expression (or logical expression) evaluates to one of two states, True or False. Python provides the Boolean type that can be either False or True. Many functions and operations return Boolean objects. The not keywords can also be used to inverse a Boolean type. Integer - ANSWERS-Those #'s that are devoid of the fractional part Whole numbers: Ex. 17 Floating-Point Numbers - ANSWERS-(or simply floats), that contain (or are able to contain) the fractional part. Syntax - ANSWERS-A set of rules used to determine if a certain string of words form a valid sentence.

Strings - ANSWERS-Are used when you need to process text. (Strings need "quotes"). It is not intended to be executed, and should be taken as is. Comments - ANSWERS-A comment is a piece of text that begins with [#] (hash) sign and extends to the end of the line. [print()] - ANSWERS-is a function that prints the specified message to the screen, or other standard output device. [input()] - ANSWERS-The [inpout()] function is able to read data entered by the user and to return the same data to the running program. The program can manipulate the data, making the code truly interactive. *The function will switch the console to input mode. *The result of the [input()] function is also a string. [0b] - ANSWERS-binary [0o] - ANSWERS-Octal: If an integer # is preceded by an [0o] prefix (zero - o) it will be treated as an octal value. This means that the # must contain digits taken from the {0.....7} range only. [0x] - ANSWERS-Hexadecimal Numeric Operators - ANSWERS-Symbols in programming language, which are able to operate on the values. Example: + , - , * , / , // , % , **

[] - ANSWERS-A double asterisk sign is an exponentiation (power) operator. The left argument is the base, its right, the exponent. Example: [23] [*] - ANSWERS-An asterisk is multiplication [/] - ANSWERS-A slash is division Note: The result produced by the division operator is always a float [%] - ANSWERS-A [%] (percent sign) is a reminder (modulo), aka remainder left after the integer division. Example: [14%4] = 4+4+4=12 14/12= [//} - ANSWERS-A [//] (double slash) sign is an integer divisional operator. NOTE: NOT FLOAT!! The answer is rounded to the lesser integer. Example: 2.7=2 2.3= [+] - ANSWERS-Addition [-] - ANSWERS-Subtraction

Tuples - ANSWERS-Ordered immutable sequences of objects. AKA you cannot edit them. (10,"hello",200.3) Sets - ANSWERS-Unordered collection of unique objects. {"a","b"} [type()] - ANSWERS-Is used to check the type of object a variable is a= type(a) int [len()] - ANSWERS-Checks the length of the input len("hello") 5 list1 = [1,2,3] - ANSWERS-Lists can be changed dict1 = {'key1': 'value1'} - ANSWERS-dictionary can be changed tuple1 = (1,2,3) - ANSWERS-Tuples cannot be changed

list.index('b') - ANSWERS-identified the index position of an item in a list