
PCAP – Certified Associate in Python Programming Free Sample Test / Practice test ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Exam Information Exam name: PCAP – Certified Associate in Python Programming Exam version: PCAP-31-02 Exam duration: 65 minutes (exam items) + 10 minutes (exam tutorial/Non-Disclosure Agreement) Number of questions: 40 Format: Single-choice and multiple-choice questions Passing score: 70% (28/40 points) Exam item weight: each question is worth 1 point About this Sample Test This Sample Test covers the following topics: 1. Control and Evaluations (questions 1-10) 2. Data Aggregates (questions 11-20) 3. Functions and Modules (questions 21-30) 4. Classes, Objects, and Exceptions (questions 31-40) See full Exam Syllabus at https://pythoninstitute.org/pcap-exam-syllabus/ Check out whether you are ready to take your certification exam! The practice questions you find here will give you a good idea of what kind of questions will appear on the real PCAP – Certified Associate in Python Programming exam that you can sit at a Pearson VUE Test Center. PCAP-31-02 Exam Information and Registrations: https://home.pearsonvue.com/PythonInstitute ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Contents Control and Evaluations (25%) Questions 1-10 Data Aggregates (25%) Questions 11-20 Functions and Modules (25%) Questions 21-30 Classes, Objects, and Exceptions (25%) Questions 31-40 ANSWER KEY FAQ ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 1 The following expression 2 ** 3 ** 2 ** 1 is: A. invalid B. equal to 16 C. equal to 16.0 D. equal to 512 E. equal to 64 F. equal to 128.0 ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 2 If you want to build a string that reads: Peter's sister's name's "Anna" which of the following literals would you use? (Select all that apply) A. "Peter's sister's name's \"Anna\"" B. 'Peter\'s sister\'s name\'s \"Anna\"' C. "Peter's sister's name's "Anna"" D. 'Peter's sister's name's "Anna"' ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 3 What is the expected output of the following snippet? i = 250 while len(str(i)) > 72: i *= 2 else: i //= 2 print(i) A. 125 B. 250 C. 72 D. 500 ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 4 What snippet would you insert in the line indicated below: n = 0 while n < 4: n += 1 # insert your code here to print the following string to the monitor after the loop finishes its execution: 1 2 3 4 A. print(n) B. print(n, sep=" ") C. print(n, end=" ") D. print(n, " ") ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 5 What is the value type returned after executing the following snippet? x = 0 y = 2 z = len("Python") x = y > z print(x) A. int B. float C. str D. bool E. NoneType ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 6 What will the final value of the Val variable be when the following snippet finishes its execution? Val = 1 Val2 = 0 Val = Val ^ Val2 Val2 = Val ^ Val2 Val = Val ^ Val2 A. 0 B. 1 C. 2 D. 4 E. The code is erroneous ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 7 Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select all that apply) Code: z, y, x = 2, 1, 0 x, z = z, y y = y - z # put line here print(x, y, z) Expected output: 0, 1, 2 A. x, y, z = y, z, x B. z, y, x = x, z, y C. y, z, x = x, y, z D. The code is erroneous ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 8 What is the expected output of the following snippet? a = 0 b = a ** 0 if b < a + 1: c = 1 elif b == 1: c = 2 else: c = 3 print(a + b + c) A. 1 B. 2 C. 3 D. The code is erroneous ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 9 How many stars (*) does the following snippet print? i = 10 while i > 0 : i -= 3 print("*") if i <= 3: break else: print("*") A. three B. two C. one D. The code is erroneous ____________________________________________________________________________________________ www.pythoninstitute.org | Program Your Future Last updated: August 21, 2018 Copyright © 2017-2018 OpenEDG Python Institute. All Rights Reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the OpenEDG | Open Education and Development Group. Question 10 How many lines does each of the following code examples output when run separately? # Example 1 for i in range(1,
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages45 Page
-
File Size-