Certified Associate in Python Programming v1.0 (PCAP)

Page:    1 / 5   
Total 73 questions

Assuming that the V variable holds an integer value to 2, which of the following operators should be used instead of OPER to make the expression equal to 1?

V OPER 1 -

  • A. <<<
  • B. >>>
  • C. >>
  • D. <<

Answer : A

How many stars (*) does the following snippet print?

  • A. the code is erroneous
  • B. five
  • C. three
  • D. four

Answer : D



  • A. the name of an operating system
  • B. a standard for encoding and handling texts
  • C. the name of a programming language
  • D. the name of a text processor

Answer : B


What is the expected output of the following snippet?

  • A. *- **-**-**-*
  • B. *-**-**-**-**-**-**-**-*
  • C. *-*
  • D. *-**-*

Answer : A


Which of the listed actions can be applied to the following tuple? (Select two answers)

  • A. tup [:]
  • B. tup.append (0)
  • C. tup [0]
  • D. del tup

Answer : CD


Executing the following snippet -

will cause the dct:

  • A. to hold two keys named "˜pi"™ linked to 3.14 and 3.1415 respectively
  • B. to hold two key named "˜pi"™ linked to 3.14 and 3.1415
  • C. to hold one key named "˜pi"™ linked to 3.1415
  • D. to hold two keys named "˜pi"™ linked to 3.1415

Answer : C

How many elements will the list1 list contain after execution of the following snippet?

  • A. two
  • B. zero
  • C. one
  • D. three

Answer : C

Which of the equations are True? (Select two answers)

  • A. chr (ord (x)) = = x
  • B. ord (ord (x)) = = x
  • C. chr (chr (x)) = = x
  • D. ord (chr (x)) = = x

Answer : AD

If you want to transform a string into a list of words, what invocation would you use? (Select two answers)
Expected output:


  • A. s.split ()
  • B. split (s, "˜ "˜)
  • C. s.split ("˜ "˜)
  • D. split (s)

Answer : stAC

Assuming that 1 -
is a four-element list is there any difference between these two statements?

  • A. yes, there is, the first line empties the list, the second line deletes the list as a whole
  • B. yes, there is, the first line deletes the list as a whole, the second line just empties the list
  • C. no, there is no difference
  • D. yes, there is, the first line deletes the list as a whole, the second line removes all the elements except the first one

Answer : B

What should you put instead of XXX to print out the module name?

  • A. main
  • B. _main_
  • C. __main__
  • D. ___main___

Answer : C


Files with the suffix .pyc contain:

  • A. Python 4 source code
  • B. backups
  • C. temporary data
  • D. semi-compiled Python code

Answer : A


Package source directories/folders can be:
B. packed as a ZIP file and distributed as one file
C. rebuilt to a flat form and distributed as one directory/folder
D. removed as Python compiles them into an internal portable format

Answer : D

What can you deduce from the line below? (Select two answers)

  • A. import a.b.c should be placed before that line
  • B. f () is located in subpackage c of subpackage b of package a
  • C. the line is incorrect
  • D. the function being invoked is called a.b.c.f ()

Answer : BD

A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:

  • A. lambda (x, y) = x ** y
  • B. lambda (x, y): x ** y
  • C. def lambda (x, y): return x ** y
  • D. lambda x, y: x ** y

Answer : D

Page:    1 / 5   
Total 73 questions