Docsity

PCEP Certified Entry-Level Python Programmer Exam Review Verified Solutions and Study Guid, Exams of Information Technology

Toggle sidebar
bg1
PCEP Certified Entry-Level Python Programmer Exam
Review Verified Solutions and Study Guide for
Programming Fundamentals, Machine Language,
Compilation, and Interpretation
The instructions that control computer hardware and make it work. - correct
answer ✅program
a set of primitive instructions built into every computer. The instructions are
in the form of binary code, so you have to enter binary codes for various
instructions. - correct answer ✅machine language
The alphabet of a machine language. A complete set of known commands.
Different types of computers may vary depending on the size of their _____s,
and the instructions could be completely different in different models. -
correct answer ✅Instruction List (IL)
Any one of the languages spoken that evolved naturally. - correct answer
✅natural language
somewhat similar to natural languages in that they use symbols, words and
conventions readable to humans. These languages enable humans to express
commands to computers that are much more complex than those offered by
ILs. - correct answer ✅high-level programming languages
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

Partial preview of the text

Download PCEP Certified Entry-Level Python Programmer Exam Review Verified Solutions and Study Guid and more Exams Information Technology in PDF only on Docsity!

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

The instructions that control computer hardware and make it work. - correct answer ✅program a set of primitive instructions built into every computer. The instructions are in the form of binary code, so you have to enter binary codes for various instructions. - correct answer ✅machine language The alphabet of a machine language. A complete set of known commands. Different types of computers may vary depending on the size of their _____s, and the instructions could be completely different in different models. - correct answer ✅Instruction List (IL) Any one of the languages spoken that evolved naturally. - correct answer ✅natural language somewhat similar to natural languages in that they use symbols, words and conventions readable to humans. These languages enable humans to express commands to computers that are much more complex than those offered by ILs. - correct answer ✅high-level programming languages

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

A program written in a high-level programming language. - correct answer ✅source code the file containing the source code - correct answer ✅source file 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 file if the code is intended to be run under MS Windows) containing the machine code; now you can distribute the file worldwide; the program that performs this translation is called a compiler or translator. - correct answer ✅compilation you (or any user of the code) can translate the source program each time it has to be run; the program performing this kind of transformation is called an interpreter, as it interprets the code every time it is intended to be executed; it also means that you cannot just distribute the source code as-is, because the end-user also needs the interpreter to execute it. - correct answer ✅interpretation

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

  • the compilation itself may be a very time-consuming process - you may not be able to run your code immediately after any amendment;
  • you have to have as many compilers as hardware platforms you want your code to be run on. - correct answer ✅disadvantages of compilation
  • don't expect that interpretation will ramp your code to high speed - your code will share the computer's power with the interpreter, so it can't be really fast;
  • both you and the end user have to have the interpreter to run your code. - correct answer ✅disadvantages of interpretation Python is a(n) ________ language. - correct answer ✅interpreted Creator of Python - correct answer ✅Guido van Rossum Perl - a scripting language originally authored by Larry Wall, more traditional, more conservative than Python, and resembles some of the good old languages derived from the classic C programming language.

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

Ruby - a scripting language originally authored by Yukihiro Matsumoto. More innovative and more full of fresh ideas than Python. Python itself lies somewhere between these two creations. - correct answer ✅Rivals of Python (sometimes called "close to metal" programming): if you want to implement an extremely effective driver or graphical engine, you wouldn't use Python - correct answer ✅low-level programming although this territory is still waiting to be conquered by Python, it will most likely happen someday. - correct answer ✅applications for mobile devices write your mathematical ideas using Python, and when you're absolutely sure that your code is correct and produces valid results, you can translate it into "C". Certainly, "C" will run much faster than pure Python. - correct answer ✅Cython can communicate with existing Java infrastructure more effectively. This is why some projects find it usable and needful.

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

A function used in a program or script that causes the Python interpreter to display a value on its output device. Text must be contained within quotes. - correct answer ✅print() function code that calls a function into action - correct answer ✅function invocation passed in for function parameter function(_______) - correct answer ✅function argument consists of three elements: a keyword identifying the argument; an equal sign (=); and a value assigned to that argument; any keyword arguments have to be put after the last positional argument (this is very important) - correct answer ✅keyword arguments a special character which announces that the next character has a different meaning, e.g., _n (the newline character) starts a new output line. - correct answer ✅backslash

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

the ones whose meaning is dictated by their position, e.g., the second argument is outputted after the first, the third is outputted after the second, etc. - correct answer ✅Positional arguments A keyword parameter for the print() function that causes the function to NOT add a newline at the end of the string. - correct answer ✅end=' ' keyword parameter for the print() function that causes the function to insert the characters contained between the quotes between arguments - correct answer ✅sep=' ' a ________ is data whose values are determined by the _______ itself - correct answer ✅literal A sequence of characters - correct answer ✅string whole numbers - correct answer ✅integer non-empty decimal fractions - correct answer ✅floating point numbers

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

desired output: I like "Monty Python" print("I like "Monty Python"") or print('I like "Monty Python"') - correct answer ✅quotes and escapes a special literal that is used in Python to represent the absence of a value - correct answer ✅NoneType special symbols or keywords which are able to operate on the values and perform (mathematical) operations, e.g., the * operator multiplies two values: x * y - correct answer ✅operator an exponentiation (power) operator. Its left argument is the base, its right, the exponent - correct answer ✅** (double asterisk) a multiplication operator - correct answer ✅* (asterisk) a divisional operator - correct answer ✅/ (slash)

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

value in front of the slash - correct answer ✅dividend value behind the slash - correct answer ✅divisor The result produced by the division operator is always a _______ - correct answer ✅float an integer divisional operator. results are always rounded (unless the divisor or dividend is a float) - correct answer ✅// (double slash) The operation that divides two numbers and chops off the fraction part. (another name for integer division) - correct answer ✅floor division remainder left after the integer division example: print(14 % 4) is equal to 2 - correct answer ✅% (modulo) adds two numbers - correct answer ✅+ (addition)

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

Operators like x++ which means x = x + 1 or x *=y which means x = x * y. - correct answer ✅shortcut operators Changes a value by rounding it to a specific number of decimal places. Example: round(miles_to_kilometers, 2) - correct answer ✅round() function a named location reserved to store values in the memory. A variable is created or initialized automatically when you assign a value to it for the first time. - correct answer ✅variable Each variable must have a unique name - an _______. A legal _______ name must be a non-empty sequence of characters, must begin with the underscore(_), or a letter, and it cannot be a Python keyword. The first character may be followed by underscores, letters, and digits. _______s in Python are case-sensitive. - correct answer ✅identifier Python is a _______ _______ language, which means you don't need to declare variables in it. To assign values to variables, you can use a simple

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

assignment operator in the form of the equal (=) sign, i.e., var = 1. - correct answer ✅dynamically-typed When the variable is name something that describes it's purpose Example: squareArea, totalApples, - correct answer ✅self-commenting A program which doesn't get a user's input - correct answer ✅deaf program The default result of the input() function is a _______ - correct answer ✅String the ________ function takes one argument (e.g., a string: int(string)) and tries to convert it into an integer. If it fails, the whole program will fail too. example: ______(input("Please input a value here: ") - correct answer ✅int() the _______ function takes one argument (e.g., a string: float(string)) and tries to convert it into a float (the rest is the same). - correct answer ✅float()

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

The _______ operator compares the values of two operands, too. Here is the difference: if they are equal, the result of the comparison is False. If they are not equal, the result of the comparison is True. - correct answer ✅!= (not equal to) True if the left operand's value is greater than the right operand's value, and False otherwise - correct answer ✅> (greater than) True if the left operand's value is less than the right operand's value, and False otherwise - correct answer ✅< (lesser than) True if the left operand's value is greater than or equal to the right operand's value, and False otherwise - correct answer ✅>= (greater than or equal to) True if the left operand's value is less than or equal to the right operand's value, and False otherwise - correct answer ✅<= (lesser than or equal to)

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

stands for else if. if the first test evaluates to False, continues with the next one - correct answer ✅elif To terminate your program, just press Ctrl-C (or Ctrl-Break on some computers). This is called a _______ _______ - correct answer ✅KeyboardInterrupt executes a statement or a set of statements as long as a specified boolean condition is true, e.g.: Example 1: while True: print("Stuck in an infinite loop.") Example 2: counter = 5 while counter > 2: print(counter) counter -= 1 - correct answer ✅while loop

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

for letter in text: if letter == "P": break print(letter, end="") - correct answer ✅break You use ________ to skip the current iteration, and continue with the next iteration, e.g.: text = "pyxpyxpyx" for letter in text: if letter == "x": continue print(letter, end="") - correct answer ✅continue The _______ clause executes after the loop finishes its execution as long as it has not been terminated by break, e.g.: n = 0

Review Verified Solutions and Study Guide for

Programming Fundamentals, Machine Language,

Compilation, and Interpretation

while n != 3: print(n) n += 1 else: print(n, "else") print() for i in range(0, 3): print(i) else: print(i, "else") - correct answer ✅else The _______ function generates a sequence of numbers. It accepts integers and returns range objects. The syntax of range() looks as follows: range(start, stop, step)