PCAP: Python Essentials 2 – Module 2 Test Answers

PCAP: Python Essentials 2 – Module 2 Test Answers.Learn programming from scratch and master Python. cisco free course answer 2022
pcap module 2 ans


Python Essentials - Final Test:

Warning!
For searching questions, CTRL+F .if you want correct answer.. type manually.Don't Copy & paste questions in search space.
If you copy paste questions in search options means.. you can't find answer

 

  1. The following code:

    print(ord('c') - ord('a'))

    prints:

    • 0
    • 2
    • 3
    • 1
  2. The following code:

    print (float("1, 3" ))

    • prints 1, 3
    • raises a ValueError exception
    • prints 1.3
    • prints 13
  3. The top-most Python exception is called:

    • TopException
    • Exception
    • BaseException
    • PythonException
  4. The following statement:

    assert var == 0

    • is erroneous
    • will stop the program when var != 0
    • has no effect
    • will stop the program when var == 0
  5. UNICODE is a standard:

    • used by coders from universities
    • honored by the whole universe
    • like ASCII, but much more expansive
    • for coding floating-point numbers
  6. ASCII is:

    • a predefined Python variable name
    • a standard Python module name
    • a character name
    • short for American Standard Code for Information Interchange
  7. The following code:

    print(3 * 'abc' +'xyz')

    prints:

    • xyzxyzxyzxyz
    • abcabcxyzxyz
    • abcabcabcxyz
    • abcxyzxyzxyz
  8. UTF-8 is:

    • a Python version name
    • the 9th version of the UTF standard
    • a form of encoding Unicode code points
    • a synonym for byte
  9.  Entering the try: block implies that:

    • all of the instructions from this block will be executed
    • some of the instructions from this block may not be executed
    • the block will be omitted
    • none of the instructions from this block will be executed
  10. What is the expected output of the following code?

    try
         print("5"/0)
    except ArithmeticError:
         print("arith")
    except ZeroDivisionError:
         print("zero")
    except:
         print("some")
    • zero
    • 0
    • some
    • arith
  11. The unnamed except: block:

    • must be the first one 
    • can be placed anywhere
    • cannot be used if any named block has been used
    • must be the last one
  12. The following code:

    print('Mike' > " Mikey")

    prints:

    • 0
    • 1
    • True
    • False
  13. The following code:

    print(chr(ord('z') - 2))

    prints:

    • z
    • y
    • a
    • x
  14. The following code:

    x  = '\' '

    print(len(x))

    prints:

    • 3
    • 2
    • 20
    • 1
  15. Which of the following are examples of Python built-in concrete exceptions?(Select two answers)

    • ArithemticError
    • IndexError
    • BaseException
    • ImportError
Python Essentials - Final Test:

Post a Comment

If you have any doubts, Ask here..,
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.