Skip to content
  • Home
  • CCNA Labs
    • CCNA 1 LAB Activities (v6 & v7)
    • CCNA 2 LAB Activities (v6 & v7)
    • CCNA 3 LAB Activities (v6 & v7)
    • CCNA 4 Lab Activities
  • Linux
    • Linux Unhatched
    • Linux Essentials 2.0
    • Linux Essentials
    • Introduction to Linux I
    • Introduction to Linux II
  • Programming
    • PCAP – Programming Essentials in Python
    • CLA – Programming Essentials in C
    • CPA Programming Essentials in C++
  • About
    • Contact Us
    • Privacy Policy

CCNA 7 Exam Answers 2023

Go with our CCIE, Passed 100%

  • ITE
    • ITE - IT Essentials v7.0
    • ITE - IT Essentials v6.0
      • IT Essentials Lab 2019
    • ITE v5.0 Exam
    • Virtual Activity Laptop
    • Virtual Activity Desktop
  • NE
    • MF
  • CCNA
    • CCNA1
      • CCNA1 v7.0 – ITN
      • CCNA1 v6.0
    • CCNA2
      • CCNA2 v7.0 – SRWE
      • CCNA2 v6.0
    • CCNA3
      • CCNA3 v7.0 – ENSA
      • CCNA3 v6.0
    • CCNA4
      • CCNA4 v6.0
  • Cyber-Security
    • ITC – Introduction to Cybersecurity 2.1 (Level 1)
    • CE – Cybersecurity Essentials 1.1 (Level 2)
    • CCNA CyberOps 1.1 (Level 3)
  • Security
    • CCNA Security v2
  • DevNet
  • CCNA PT Lab 2023

PCAP – Programming Essentials in Python Quizzes Module 2 Test Answers

Last Updated on May 20, 2021 by Admin

PCAP – Programming Essentials in Python Quizzes Module 2 Test Answers

  1. An operator able to check whether two values are equal is coded as:

    • =
    • ===
    • ==
    • !=
  2. The value eventually assigned to x is equal to:

    x = 1
    x = x == x

    • False
    • 1
    • True
    • 0
  3. How many stars will the following snippet send to the console?

    i = 0
    while i <= 3 :
    i += 2
    print(“*”)

    • two
    • zero
    • one
    • three
  4. How many stars will the following snippet send to the console?

    i = 0
    while i <= 5 :
    i += 1
    if i % 2 == 0:
    break
    print(“*”)

    • zero
    • one
    • two
    • three
  5. How many hashes will the following snippet send to the console?

    for i in range(1):
    print(“#”)
    else:
    print(“#”)

    • one
    • two
    • zero
    • three
  6. How many hashes will the following snippet send to the console?

    var = 0
    while var < 6:
    var += 1
    if var % 2 == 0:
    continue
    print(“#”)

    • two
    • zero
    • one
    • three
  7. How many hashes will the following snippet send to the console?

    var = 1
    while var < 10:
    print(“#”)
    var = var << 1

    • eight
    • one
    • four
    • two
  8. What value will be assigned to the x variable?

    z = 10
    y = 0
    x = y < z and z > y or y > z and z < y

    • 0
    • 1
    • True
    • False
  9. What is the output of the following snippet?

    a = 1
    b = 0
    c = a & b
    d = a | b
    e = a ^ b
    print(c + d + e)

    • 1
    • 3
    • 2
    • 0
  10. What is the output of the following snippet?

    lst = [3, 1, -2]
    print(lst[lst[-1]])

    • 1
    • -2
    • 3
    • -1
  11. What is the output of the following snippet?

    lst = [1,2,3,4]
    print(lst[-3:-2])

    • [2,3,4]
    • [2]
    • []
    • [2,3]
  12. The second assignment:

    vals = [0, 1, 2]
    vals[0], vals[2] = vals[2], vals[0]

    • doesn’t change the list
    • extends the list
    • shortens the list
    • reverses the list
  13. After execution of the following snippet, the sum of all vals elements will be equal to:

    vals = [0, 1, 2]
    vals.insert(0,1)
    del vals[1]

    • 2
    • 5
    • 3
    • 4
  14. Take a look at the snippet, and choose the true statement:

    nums = [1,2,3]
    vals = nums
    del vals[1:2]

    • nums is longer than vals
    • vals is longer than nums
    • nums and vals are of the same length
    • the snippet will cause a runtime error
  15. Which of the following sentences is true?

    nums = [1,2,3]
    vals = nums[-1:-2]

    • nums is longer than vals
    • nums and vals are of the same length
    • the snippet will cause a runtime error
    • vals is longer than nums
  16. What is the output of the following snippet?

    l1 = [1,2,3]
    l2 = []
    for v in l1:
    l2.insert(0,v)
    print(l2)

    • [3,2,1]
    • [1,2,3]
    • [3,3,3]
    • [1,1,1]
  17. What is the output of the following snippet?

    l1 = [1,2,3]
    for v in range(len(l1)):
    l1.insert(1,l1[v])
    print(l1)

    • [1, 2, 3, 3, 2, 1]
    • [1, 2, 3, 1, 2, 3]
    • [3, 2, 1, 1, 2, 3]
    • [1, 1, 1, 1, 2, 3]
  18. How many elements does the L list contain?

    L = [i for i in range(-1,2)]

    • one
    • four
    • three
    • two
  19. What is the output of the following snippet?

    T = [[3-i for i in range (3)] for j in range (3)]
    s = 0
    for i in range(3):
    s += T[i][i]
    print(s)

    • 4
    • 2
    • 7
    • 6
  20. What is the output of the following snippet?

    L = [[0, 1, 2, 3] for i in range(2)]
    print(L[2][0])

    • the snippet will cause a runtime error
    • 1
    • 2
    • 0
  • CCNA1 v7
  • CCNA2 v7
  • CCNA3 v7
System Test Exam Answers
Modules 1 – 3 Exam Answers
Modules 4 – 7 Exam Answers
Modules 8 – 10 Exam Answers
Modules 11 – 13 Exam Answers
Modules 14 – 15 Exam Answers
Modules 16 – 17 Exam Answers
Practice Final – ITN Answers
Course Feedback
ITN Practice PT Skills Assessment (PTSA)
Final Exam Answers
Modules 1 – 4 Exam Answers
Modules 5 – 6 Exam Answers
Modules 7 – 9 Exam Answers
Modules 10 – 13 Exam Answers
Modules 14 – 16 Exam Answers
ITN Practice Skills Assessment – PT Answers
SRWE Practice Skills Assessment – PT Part 1 Answers
SRWE Practice Skills Assessment – PT Part 2 Answers
SRWE Hands On Skills Exam Answers
SRWE Practice Final Exam Answers
SRWE Final Exam Answers 
Modules 1 – 2 Exam Answers
Modules 3 – 5 Exam Answers
Modules 6 – 8 Exam Answers
Modules 9 – 12 Exam Answers
Modules 13 – 14 Exam Answers
ITN Practice PT Skills Assessment (PTSA) Answers
SRWE Practice PT Skills Assessment (PTSA) – Part 1 Answers
SRWE Practice PT Skills Assessment (PTSA) – Part 2 Answers
ENSA Practice PT Skills Assessment (PTSA) Answers
ENSA Hands On Skills Exam Answers
Practice Final – ENSA Answers
ENSA Final Exam Answers
CCNA Certification Practice Exam Answers

Copyright © 2023 PressExam.