PCAP : Certified Associate in Python Programming : Part 01

  1. What will be the value of the i variable when the while e loop finishes its execution?

    PCAP Certified Associate in Python Programming Part 01 Q01 001
    PCAP Certified Associate in Python Programming Part 01 Q01 001
    • 1
    • 0
    • 2
    • the variable becomes unavailable
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q01 002
    PCAP Certified Associate in Python Programming Part 01 Q01 002
  2. And operator able to perform bitwise shifts is coded as (Choose two.)

    • ++
    • <<
    • >>

    Explanation:

    Reference: https://www.geeksforgeeks.org/basic-operators-python/

  3. What will the value of the i variable be when the following loop finishes its execution?

    PCAP Certified Associate in Python Programming Part 01 Q03 003
    PCAP Certified Associate in Python Programming Part 01 Q03 003
    • 10
    • the variable becomes unavailable
    • 11
    • 9
    Explanation:
    Reference: https://www.programiz.com/python-programming/pass-statement
  4. The following expression

    PCAP Certified Associate in Python Programming Part 01 Q04 004
    PCAP Certified Associate in Python Programming Part 01 Q04 004

    is:

    • equal to 1
    • invalid
    • equal to 2
    • equal to -1
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q04 005
    PCAP Certified Associate in Python Programming Part 01 Q04 005
  5. A compiler is a program designed to (Choose two.)

    • rearrange the source code to make it clearer
    • check the source code in order to see of it’s correct
    • execute the source code
    • translate the source code into machine code
  6. What is the output of the following piece of code?

    PCAP Certified Associate in Python Programming Part 01 Q06 006
    PCAP Certified Associate in Python Programming Part 01 Q06 006
    • ant’ bat’ camel
    • ant”bat” camel
    • antbatcamel
    • print (a, b, c, sep= ‘ ” ’)
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q06 007
    PCAP Certified Associate in Python Programming Part 01 Q06 007
  7. What is the expected output of the following snippet?

    PCAP Certified Associate in Python Programming Part 01 Q07 008
    PCAP Certified Associate in Python Programming Part 01 Q07 008
    • the code is erroneous
    • 3
    • 7
    • 15
  8. How many lines does the following snippet output?

    PCAP Certified Associate in Python Programming Part 01 Q08 009
    PCAP Certified Associate in Python Programming Part 01 Q08 009
    • three
    • one
    • two
    • four
  9. Which of the following literals reflect the value given as 34.23? (Choose two.)

    • .3423e2
    • 3423e-2
    • .3423e-2
    • 3423e2
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q09 010
    PCAP Certified Associate in Python Programming Part 01 Q09 010
  10. What is the expected output of the following snippet?

    PCAP Certified Associate in Python Programming Part 01 Q10 011
    PCAP Certified Associate in Python Programming Part 01 Q10 011
    • 3
    • 1
    • 2
    • the code is erroneous
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q10 012
    PCAP Certified Associate in Python Programming Part 01 Q10 012
  11. Assuming that the following snippet has been successfully executed, which of the equations are True? (Choose two.)

    PCAP Certified Associate in Python Programming Part 01 Q11 013
    PCAP Certified Associate in Python Programming Part 01 Q11 013
    • len(a) == len (b)
    • b [0] +1 ==a [0]
    • a [0] == b [0]
    • a [0] + 1 ==b [0]
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q11 014
    PCAP Certified Associate in Python Programming Part 01 Q11 014
  12. Assuming that the following snippet has been successfully executed, which of the equations are False? (Choose two.)

    PCAP Certified Associate in Python Programming Part 01 Q12 015
    PCAP Certified Associate in Python Programming Part 01 Q12 015
    • len(a)== len (b)
    • a [0]-1 ==b [0]
    • a [0]== b [0]
    • b [0] – 1 ==a [0]
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q12 016
    PCAP Certified Associate in Python Programming Part 01 Q12 016
  13. Which of the following statements are true? (Choose two.)

    • Python strings are actually lists
    • Python strings can be concatenated
    • Python strings can be sliced like lists
    • Python strings are mutable
    Explanation:
    Reference: https://docs.python.org/2/tutorial/introduction.html
  14. Which of the following sentences are true? (Choose two.)

    • Lists may not be stored inside tuples
    • Tuples may be stored inside lists
    • Tuples may not be stored inside tuples
    • Lists may be stored inside lists
    Explanation:
    Reference: https://www.afternerd.com/blog/python-lists-for-absolute-beginners/
  15. Assuming that String is six or more letters long, the following slice

    PCAP Certified Associate in Python Programming Part 01 Q15 017
    PCAP Certified Associate in Python Programming Part 01 Q15 017

    is shorter than the original string by:

    • four chars
    • three chars
    • one char
    • two chars
  16. What is the expected output of the following snippet?

    PCAP Certified Associate in Python Programming Part 01 Q16 018
    PCAP Certified Associate in Python Programming Part 01 Q16 018
    • 1
    • 4
    • 2
    • 3
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q16 019
    PCAP Certified Associate in Python Programming Part 01 Q16 019
  17. What is the expected output of the following snippet?

    PCAP Certified Associate in Python Programming Part 01 Q17 020
    PCAP Certified Associate in Python Programming Part 01 Q17 020
    • abc
    • The code will cause a runtime exception
    • ABC
    • 123
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q17 021
    PCAP Certified Associate in Python Programming Part 01 Q17 021
  18. How many elements will the list2 list contain after execution of the following snippet?

    PCAP Certified Associate in Python Programming Part 01 Q18 022
    PCAP Certified Associate in Python Programming Part 01 Q18 022
    • zero
    • five
    • seven
    • three
    Explanation:
    PCAP Certified Associate in Python Programming Part 01 Q18 023
    PCAP Certified Associate in Python Programming Part 01 Q18 023
  19. What would you used instead of XXX if you want to check weather a certain ‘key’ exists in a dictionary called dict? (Choose two.)

    PCAP Certified Associate in Python Programming Part 01 Q19 024
    PCAP Certified Associate in Python Programming Part 01 Q19 024
    • ‘key’ in dict
    • dict [‘key’] != None
    • dict.exists (‘key’)
    • ‘key’ in dict.keys ( )
    Explanation:
    Reference: https://thispointer.com/python-how-to-check-if-a-key-exists-in-dictionary/
  20. You need data which can act as a simple telephone directory. You can obtain it with the following clauses (Choose two.) (assume that no other items have been created before)

    • dir={‘Mom’: 5551234567, ‘Dad’: 5557654321}
    • dir= {‘Mom’: ‘5551234567’, ‘Dad’: ‘5557654321’}
    • dir= {Mom: 5551234567, Dad: 5557654321}
    • dir= {Mom: ‘5551234567’, Dad: ‘5557654321’}
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments