You are on page 1of 10
3720724, 11:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Ceribrary.com ~~ library 10 v Question 21 ( Topic 1) Cana module run like regular code? A. yes, and it can differentiate its behavior between the regular launch and import B. it depends on the Python version C. yes, but in cannot differentiate its behavior between the regular launch and import D. no, it is not possible; a module can be imported, not run Answer: A Question 22 ( Topic 1) Select the valid fun () invocations: (Choose two.) def fun (a, b=0): retum ath nips. certrary.comiexarvPCAP? +0 004, 1:58AM Pyton Insitute PCAP Exam - Questions and Answers - Catibran.com A. fun (b=1) B, fun (a=0) C. fun (b=1, 0) D. fun (1) Answer : thBD Question 23 ( Topic 1) Afile name like this one below says that: (Choose three.) services, cpython 36.pyc A. the interpreter used to generate the file is version 3.6 B. it has been produced by CPython C. it is the 36 version of the file D. the file comes from the services.py source file Answer : ABD Question 24 ( Topic 1) What is the expected behavior of the following snippet? nips. certrary.comiexarvPCAP? 20 3720124, 1:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com defa (I, I): return | [I] print (a (0, [1) ) It will: A. cause a runtime exception B. print1 C. print 0, (1) D. print [1] Answer : A Explanation: Crane oy tara a Ca @, [1)) vd Fe ny ner TET EET) Pot eC ames) Syntaxfrror: invalid syntax nips. certrary.comiexarvPCAP? 3720724, 11:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Question 25 ( Topic 1) What can you do if you dona€™t like a long package path like this one? import alpha -beta . gamma .delta epsilon .zeta A. you can make an alias for the name using the alias keyword B. nothing, you need to come to terms with it C. you can shorten it to alpha . zeta and Python will find the proper connection D. you can make an alias for the name using the as keyword Answer : D Reference: https://stackoverflow.com/questions/706595/can-you-define-aliases-for- imported-modules-in-python Question 26 ( Topic 1) What is the expected output of the following code? nips. certrary.comiexarvPCAP? 40 13720724, 11:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com str = ‘abcdef’ def fun (s): del s [2] return s print (fun (str) ) A. abcef B. The program will cause a runtime exception/error C.acdef D.abdef Answer : B Explanation: ere eee ees CR, Co mace CIC tg print (fun(str)) aC. oS Marc etre CS Sac) See Soe sete seat ntps:ww.certrary.comiexaryPCAP? 3720724, 11:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Question 27 ( Topic 1) What is the expected output of the following code? deff (n): ifn == 1: return ‘1’ return str (n) + f (n-1) print (f (2) ) A.21 B.2 C3 D.12 Answer : A Explanation: nips. certrary.comiexarvPCAP? 610 3720724, 1:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Ceribrary.com Question 28 ( Topic 1) What is the expected behavior of the following snippet? def x(): # line 01 return 2 # line 02 x=1+x() # line 03 print (x) # line 04 It will: A. cause a runtime exception on line 02 B. cause a runtime exception on line 01 C. cause a runtime exception on line 03, D. print 3 nips. certrary.comiexarvPCAP? 3720124, 1:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com Answer : D Explanation: Question 29 ( Topic 1) What is the expected behavior of the following code? def f (n): for iin range (1, n+1): yield I print (f(2) ) It will: A. print 4321 nips. certrary.comiexarvPCAP? 3720124, 1:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com B. print C. cause a runtime exception D. print 1234 Answer : B Explanation: generator object f at 0x7£8002e74ab0: Question 30 ( Topic 1) If you need a function that does nothing, what would you use instead of XXX? (Choose two.) def idler (): xxx A. pass B. return C. exit D. None nips. certrary.comiexarvPCAP? ono 3720724, 11:56 AM Pytnon Institute PCAP Exam - Questions and Answers -Certibrary.com EXPOSE CORRECT ANSWER Answer : AD Reference: https: //www-pythoncentral.io/python-null-equivalent-none/ NEXT QUESTION Page: 3/15 © @ __ Examcontains 147 questions Q'sperpage: 10 » QB «7 EXPAND ALL Talk to us! Have any questions or issues ? Please dont hesitate to contact us support @certlibrary.com Ccertlbrary com is owmed by MBS Tech Limited: Room 1905 Nam Wo Hong Bullding, 148 Wing Lok street, Sheung Wan, Hong Kong. Company registration number: 2310926 Certibrary doesn’t offer Real Microsoft Exam Questions. Cetibrary Materials do not contaln actual questions and answers from Cisco's Certification Exams. CCEA Institute does not endorse, promote of warrant the accuracy or quality of Certibrary. CFA® and charter anclal Analyst ® are cgistered trademarks owned by CFA Institut. Terms & Conditions |Privacy Policy intps:twwwceriibray.comiexanvPCAP? 10110

You might also like