PCAP-31-03 Practice Exam: PCAP – Certified Associate in Python Programming Certification by Lacanienta Jeremias

PCAP-31-03 Practice Exam: PCAP – Certified Associate in Python Programming Certification by Lacanienta Jeremias

Author:Lacanienta, Jeremias [Lacanienta, Jeremias]
Language: eng
Format: epub
Published: 2021-07-29T16:00:00+00:00


[ ] print(exception.params)

[X] print(exception)

[X] print(exception.args)

[ ] print(exception.iterable[:])

Explanation:

print(exception) # prints .args via __str__() e.g. ('spam', 'eggs')

print(exception.args) # prints .args e.g. ('spam', 'eggs')

Question >>>

What is the output of the following code?

>>> type(Exception().args)

( ) <class 'str'>

( ) <class 'list'>

(X) <class 'tuple'>

( ) <class 'dict'>

Explanation:

args is a tuple of arguments given to the exception constructor.

Question >>>

What is the output of the following code?

>>> try :

... raise Exception( 'spam' , 'eggs' )

... except Exception as inst:

... x, y = inst.args

>>> x, y



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.