bomonike

python-exams.png

Python Exams

Certification exams validate your expertise to show potential schools, scholarships, and employers that you are serious about your education and career.

The OpenEDG Python Institute administers this progression of Python certification exams:

python-certs-map=1200x253.png

  1. 20% off $59   PCEP™ (Certified Entry-Level Python Programmer exam PCEP-30-0x) asks 30 questions over 40 minutes
    https://pythoninstitute.org/pcep
  2. 50% off $295 PCAP™ (Certified Associate Python Programmer exam PCAP-31-0x) asks 31 questions over 65 minutes
    https://pythoninstitute.org/pcap
  3. $225 PCAPP1™ (Certified Professional Python Programmer Level 1 Exam PCPP-32-101) asks 45 questions over 65 minutes
    https://pythoninstitute.org/pcpp1
  4. $195 PCAPP2™ (Certified Professional Python Programmer Level 2 Exam PCPP-32-201) asks 45 questions over 65 minutes
    https://pythoninstitute.org/pcpp2

70% is the threshold for passing for all exams.

Prices above are for a single try. Exams can be purchased with a retake option and sample tests.

Cisco

Cisco’s offers at their NetAcad.com site free online Python courses developed in collaboration with OpenEDG:

  1. Click “Login” at the upper-right.
  2. Click “Sign Up” at the lower-right.
  3. Click the Google icon under “Sign up with”.
  4. Select your personal Google account - the one credly.com will use even after you leave school.
  5. Check the accept boxes, then “Accept & Continue”.
  6. Login using your Google account and associated password.

  7. Use the email address you used to log into NetAcad.com to create an account at credly.com.
  8. In Credly, click Settings, Security & Privacy, to setup two-factor authentication with your Authy mobile app.

    Continue to PE1

    https://edube.org/study/pe1

  9. Click “Python Essentials 1”
  10. Notice the PCAP (Certified Entry-Level Python Programmer) exam sections:
    1. Introduction to Python and Computer Programming
    2. Python Data Types, Variables, Operators, and Basic I/O Operations
    3. Boolean Values, Conditional Execution, Loops, Lists and List Processing, Logical and Bitwise
    4. Functions, Tuples, Dictionaries, Exceptions, and Data Processing
  11. Click “Start Course”. https://edube.org/login
  12. Scroll down to the bottom of the left menu to click “Python Essentials 2 (PE2) Course Final Exam”, then “Final Test”.
  13. Scroll down and answer all questions.
  14. Click “Submit” for your score. Hopefully you’ll see “Congratulations, you have passed the assessment.”

  15. Review items you got wrong.
  16. Click “Reset” and answer again until you get 100%, so you know you have overcome incorrect thinking. Answering the questions you already know helps you get faster.
  17. Answer the post-survey questions so you’ll get a “Discount coupon on completion of course” email from noreply@netacad.com containing a discount code unique to you.
  18. DOTHIS: Email me the discount code so I can send you the exam code.

  19. When you get the exam code, visit https://pearsonvue.com/pythoninstitute to register for the exam.

    python-pcep-badge-729x729.png

    Continue to PE2

  20. Click “Python Essentials 2”
  21. Notice the PCAP (Certified Associate in Python Programming) exam sections:
    1. Modules, Packages, and PIP
    2. Strings, String and List Methods, Exceptions
    3. Object-Oriented Programming
    4. Miscellaneous

https://edube.org/study/pe2

Repeat as above.

Passing this prep exam gets you a discount coupon for 50% ($150) off the actual $295 exam fee for a cost to you of $144.

python-pcap-badge-729x729.png

Continue to Advanced Python (PE3)

  1. Python Advanced 1 (Advanced OOP)

    • Classes, instances, attributes, methods, as well as working with class and instance data
    • Shallow and deep operations
    • Abstract classes, method overriding, static and class methods, special methods
    • Inheritance, polymorphism, subclasses, and encapsulation
    • Advanced exception handling techniques
    • The pickle and shelve modules
    • Metaclasses
  2. Python Advanced 2 (Best Practices and Standardization
    • Best practices, standardization, and coding conventions
    • How to implement the conventions for code comprising the standard library in the main Python distribution
    • The principles that influence the design of Python code
    • How to write a better and more effective code
    • How to avoid the most common errors and mistakes
  3. Python Advanced 3 (Introduction to GUI Programming in Python (TkInter)
    • what GUI is and where it came from
    • how to create Graphical User Interfaces (GUIs) in Python using the tkinter package
    • how to construct a GUI using basic blocks and conventions
    • how event-driven programming works
    • some popular and commonly used GUI environments and toolkits
    • what tkinter is and how to build a GUI with its help
    • how to use widgets, windows, and events
    • how to create basic applications based on tkinter’s application life cycle
  4. Python Advanced 4 (Working with RESTful APIs)
    • The basic concepts of network programming, REST, network sockets, and client-server communication
    • How to use and create sockets in Python, and how to establish and close the connection with a server
    • What JSON and XML files are, and how they can used in network communication
    • What HTTP methods are, and how to say anything in HTTP
    • How to build a sample testing environment
    • What CRUD is
    • How to build a simple REST client, and how to fetch and remove data from server, add new data to it, and update the already-existing data
  5. Python Advanced 5 (File Processing and Communicating with a Program’s Environment)
    • sqlite ‒ interacting with SQLite databases
    • xml ‒ creating and processing XML files
    • csv ‒ CSV file reading and writing
    • logging ‒ basics logging facility for Python
    • configparser ‒ configuration file parser

    python-pcpp1-badge-729x729.png python-pcpp2-badge-729x729.png


Cisco Final Exam 2 Question 27

def o(p):
    def q():
        return '*' * p
    return q

r = o(1)
s = o(2)
print(r() + s())

This is an example of a “closure” in Python.

The inner function o is a function factory - it creates functions on the fly and returns functions instead of a value. It allows for dynamic (parameterized) function generation with customizable behavior.

https://realpython.com/factory-method-python/

The inner function q “remembers” the value of p that was passed to the outer function o. Each call to o creates a new function with its own “remembered” value of p.

https://www.youtube.com/watch?v=JIImCgkAQxY&t=61s

Cisco Final Exam 2 Question 33

Look at the following code:

numbers = [0, 2, 7, 9, 10]
# Insert line of code here to produce [0, 4, 49, 81, 100]
print(foo)

Which line would you insert in order for the program to produce the expected output?

Choices given for the question suggests use of lambda within filter() and map() functions, all within a list:

a) foo = lambda num: num * 2, numbers
b) foo = lambda num: num ** 2, numbers
c) foo = filter(lambda num: num ** 2, numbers
) d) foo = map(lambda num: num ** 2, numbers)

Before looking at the answers, we can see that the output sought (in foo) is the square of the input numbers:

To calculate a square, we use num ** 2

QUESTION: What does the filter function do?

filter() is a built-in function that takes two parameters: a function (such as lambda) and an iterable (like a list, tuple, or set) and returns an iterator containing only the elements for which the function returns True.

The answer yields an internal Python object ID and its value from lambda:

(<function at 0x10042d4e0>, [0, 2, 7, 9, 10])</tt>

foo = list(filter(lambda num: num ** 2, numbers))

Cisco Final Exam 2 Question 34

A more complex question uses a list comprehension [i*i for i in range(5)]

numbers = [i*i for i in range(5)]
# Insert line of code here to produce [1, 9]
print(foo)

Before looking at the answers, what value is contained in the numbers variable?

range(5) produces 5 values, from 0 to 4:

[0, 1, 2, 3, 4]

QUESTION: What does the i*i do?

It multiples i by itself (turning into a square of itself), yielding:

numbers = [0, 1, 4, 9, 16]

The question is asking for [1, 9] to be produced.

So that’s the second and fourth item from the five-item input list, which are the even numbers.

x % 2 reminders would yield even numbers.

That is shown by:

print(lambda x: x % 2, numbers)

which shows internal Python object ID and its value from lambda:

<function at 0x1001dc9a0> [0, 1, 4, 9, 16]</tt>

The list() function extracts out the values of [0, 1, 4, 9, 16].

Now the choices given for the question:

a) foo = list(map(lambda x: x // 2, numbers))
b) foo = list(map(lambda x: x % 2, numbers))
c) foo = list(filter(lambda x: x / 2, numbers))
d) foo = list(filter(lambda x: x % 2, numbers))

The filter() function with lambda x: x % 2 does the following: x % 2 returns 1 (truthy) for odd numbers x % 2 returns 0 (falsy) for even numbers

This effectively keeps only the odd numbers in the list So filter(lambda x: x % 2, numbers) will keep only the odd squares: [1, 9]

QUESTION: What does the map function do?

That’s put there as a distractor.

The map() function is a built-in Python function that transforms iterables by applying a specified function to each item in an iterable.

Perplexity.ai says the answer is b:

foo = list(filter(lambda x: x % 2, numbers))

Cisco Final Exam 1 Question 35

This makes use of some methods for the random package described at https://docs.python.org/3/library/random.html

import random
# Insert lines of code here.
print(a, b, c)

Which lines of code would you insert so that it is possible for the program to output the following result:

6 82 0

Analysis:

Running the code provided is unlikely to yield “6 82 0” because the methods used generate random numbers.

https://docs.python.org/3/library/random.html#random.randint

random.randrange(10, 100, 3) # Returns a randomly selected element from range(start, stop, step).

random.randint(0, 100) # Returns a random integer N such that a <= N <= b

random.choice((0, 100, 3)) # Returns a random element from the non-empty sequence

Each set (A,B,C,D) uses output variables a,b,c using different random.methods.

Let’s analyze each command to see if it can yield “6 82 0”.

A:
a = random.randrange(10, 100, 3)
# Doesn’t qualify because 6 is < 10.
b = random.randint(0, 100)
# Can qualify because 92 can be between 0 to 100.
c = random.choice((0, 100, 3))
# Can qualify because 92 can be 0.

B:
a = random.choice((0, 100, 3))
b = random.randrange(10, 100, 3)
# Doesn’t qualify because 82 is not divisible by 3.
c = random.randint(0, 100)

C:
a = random.randint(0, 100)
b = random.randrange(10, 100, 3)
# Doesn’t qualify because 82 is not divisible by 3.
c = random.choice((0, 100, 3))

D:
a = random.randint(0, 100)
b = random.choice((0, 100, 3))
# Doesn’t qualify because 82 is not divisible by 3.
c = random.randrange(10, 100, 3)

REMEMBER: The answer choice is rearranged by the testing software:

a) B
b) C
c) D
d) A

So no good choices?