Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute Exam PCAP-31-03 Topic 1 Question 88 Discussion

Actual exam question for Python Institute's PCAP-31-03 exam
Question #: 88
Topic #: 1
[All PCAP-31-03 Questions]

Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True? (Select two answers)

Show Suggested Answer Hide Answer
Suggested Answer: B, D

Contribute your Thoughts:

C) ClassA._module_ == 'ClassA' is a trick question. The `_module_` attribute doesn't exist, it's just a made-up name.
upvoted 0 times
...
Dahlia
4 days ago
A) str(Object) == 'Object' is not correct. The `str()` function returns the string representation of an object, which may not necessarily be 'Object'.
upvoted 0 times
...
Kina
5 days ago
D) len(ClassB.__bases__) == 1 is also correct. The `__bases__` attribute of a class returns a tuple of its base classes, and we're checking the length of this tuple.
upvoted 0 times
...
Karan
28 days ago
I believe option D) len(ClassB.__bases__) == 1 is also True, as it checks the number of base classes for ClassB.
upvoted 0 times
...
Ciara
1 months ago
B) _name == _main_ is the correct answer. The `__name__` variable is set to `'__main__'` when the script is executed directly, and to the module name when it's imported.
upvoted 0 times
Paz
4 days ago
B) _name == _main_'
upvoted 0 times
...
King
7 days ago
A) str(Object) == 'Object'
upvoted 0 times
...
...
Barabara
1 months ago
I agree with Miss, option A) makes sense because it's comparing a string representation of an object.
upvoted 0 times
...
Miss
2 months ago
I think option A) str(Object) == 'Object' is True.
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77