You are on page 1of 8
3720724, 11:52AM Pytnon Institute PCAP Exam - Questions and Answers -Ceribrary.com ~~ library Certified Associate in Python Programming v1.0 Page: 7/15 ©) @)_ Examcontains 147 questions Q's per page: 10 «” EXPAND ALL Question 61 ( Topic 1) What is the expected output of the following code? def £ (n): ifn == return 1 return n+ £ (n-1) print (£(2)) A.21 B12 C3 D.none EXPOSE CORRECT ANSWER Answer :C NEXT QUESTION 8 Question 62 ( Topic 1) Amethod for passing the arguments used by the following snippet is called: ntps:hwwwceriibrary.comiexanvPCAP? 3720724, 11:52AM def fun (a, b): return a +b Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com ves = fun (1, 2) A. sequential B. named C. positional D. keyword Answer : C Question 63 ( Topic 1) What is the expected behavior of the following code? def £(n): for i in range (1, ntl): yield i for i in f (2): print (i, end= * *) It will - A print 21 B. print12 C. cause a runtime exception D. print nips. certrary.comiexarvPCAP? 28 3720724, 1:52AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Answer : B Explanation: Question 64 ( Topic 1) What is the expected output of the following code? ist = [x for x in range (5)] lst = list (filter (lambda x: x % 2 print (len(1st)) 1st)) Ad B. The code will cause a runtime exception C1 D.3 Answer : D nips. certrary.comiexarvPCAP? ae 3720/24, 11:52AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Question 65 ( Topic 1) What is the expected behavior of the following code? def unclear (x): ifxe2es return 0 print )unclear (1) + unclear (2)) It will: A. print o B. cause a runtime exception C. prints 3 D. print an empty line Answer : B Question 66 ( Topic 1) If any of a classx€™s components has a name that starts with two underscores (__), then: A. the class componenta€™s name will be mangled B. the class component has to be an instance variable C. the class component has to be a class variable D. the class component has to be a method nips. certrary.comiexarvPCAP? 3720724, 1:52AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Answer: A Reference: https://hackernoon.com/understanding-the-underscore-of-python- 309d1a029edc Question 67 ( Topic 1) If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write: A. except Ex1 Ex2: B, except (ex1, Ex2): C. except Ex1, Ex2: D. except Ex1+Ex2: Answer : B Reference: https: //www-programiz.com/python -programming/exception-handling Question 68 ( Topic 1) A function called issubclass (c1, c2) is able to check if: nips. certrary.comiexarvPCAP? 5 3720724, 1:52AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com A. ci and c2 are both subclasses of the same superclass B. c2 isa subclass of c1 C.ctisa subclass of c2 D. cand c2 are not subclasses of the same superclass Answer : C Reference: https://www.oreilly.com/library/view/python-in- a/97814,91913833/cho4.html Question 69 ( Topic 1) Aclass constructor (Choose two.) A. can return a value B. cannot be invoked directly from inside the class C. can be invoked directly from any of the subclasses D. can be invoked directly from any of the superclasses Answer : BC Question 70 ( Topic 1) nips. certrary.comiexarvPCAP? 3720724, 1:52AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX? Clase Clase: def get(sel£): return self.val def show(sel£) : mx A. print (get(self)) B. print (self.get()) C. print (get()) D. print (self.get (val)) Answer : B 10 v Talk to us! Have any questions or issues ? Please dont hesitate to contact us nips. certrary.comiexarvPCAP? 78 3720724, 11:52AM Pytnon Institute PCAP Exam - Questions and Answers -Ceribrary.com YM support@certlibrary.com Ccrtibrary com is ewmed by MBS Tech Limited: Room 1905 Nam Wo Hong Bullding, 148 Wing Lok Street, Sheung Wan, Hong Kong, Company registration number: 2310926 Certlbrary doesn't offer Real Microsoft Exam Questions Crtlibrary Materials do not contain actual questions and answers from Cisco's Certification Fxams. (CFA Institute does not endorse, promote or warrant the accuracy or quality of Certlibrary. CFA® and Chartered financial Analyst ® are registered trademarks owned by CFA Institute Terms & Conditions |Privacy Policy intps:twwwceriibray.comiexanvPCAP?

You might also like