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? (Choose two.)
Ans A,as len(ClassB.__bases__) =1,after compiled ,it show '1'.
Ans B, as ClassA.__module__ == '__main__', after compiled, it return true.
Ans C, __name__ = __main__, so __name__ != 'code.py', return is false.
Ans D, (str(Object) == 'Object',after compiled , it show 'TypeError'
Correction: if you add a comma at the front and the end of the "Object" word, after compiled, it will return true
print(str('Object') == 'Object') # Ans D, return true
Only B is correct Answer!!
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
dicksonpwc
2 years agoDamon54
1 year, 3 months agoandr3
2 years, 1 month agocarpmatias
3 years agomacxsz
3 years agoNoarmy315
3 years, 4 months agoluckymuki
3 years, 6 months ago