Free preview mode
Enjoy the free questions and consider upgrading to gain full access!
PCEP-30-02
Free trial
Verified
Question 51
After execution of the following snippet, the sum of all vals elements will be equal to:
- A: 4
- B: 5
- C: 2
- D: 3
Question 52
What is the expected output of the following code?
- A: 4
- B: 2
- C: 10
- D: 0
- E: 1
- F: 3
Question 53
What is the output of the following snippet?
- A: [0, 1, 9, 16]
- B: [0, 1, 4, 16]
- C: [0, 1, 4, 9]
- D: [1, 4, 9, 16]
Question 54
What is the expected output of the following code?
- A: [4, 3, 2, 1]
- B: [4, 3, 2]
- C: [4, 3]
- D: The code is erroneous.
Question 55
Take a look at the snippet and choose one of the following statements which is true:
- A: nums and vals are of the same length
- B: nums is longer than vals
- C: vals is longer than nums
Question 56
Take a look at the snippet, and choose the true statements: (Choose two.)
- A: nums is longer than vals
- B: nums and vals are of the same length
- C: vals is longer than nums
- D: nums and vals refer to the same list
Question 57
What is the expected output of the following code?
- A: 0 1
- B: 1 0
- C: The code is erroneous.
- D: 0 0
Question 58
What code would you insert instead of the comment to obtain the expected output?
Expected output:
Code:
- A: print(k[0])
- B: print(k)
- C: print(k['0'])
- D: print(k["0"])
Question 59
What is the expected output of the following code?
- A: 1 5 9 13
- B: 1 2 3 4
- C: 13 14 15 16
- D: 4 8 12 16
Question 60
What is the expected output of the following code?
- A: The code is erroneous.
- B: 2
- C: 1
- D: 0
Question 61
What is the expected output of the following code?
- A: [2]
- B: [3, 4, 5]
- C: The program will cause an error.
- D: [2, 3, 4, 5]
Question 62
You develop a Python application for your company.
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management.
Which code segments can you use? (Choose two.)
- A: employees[1:-5]
- B: employees[0:-5]
- C: employees[:-5]
- D: employees[0:-4]
- E: employees[1:-4]
Question 63
What is the expected output of the following code?
- A: 1 1 2 3 4 5
- B: 2 3 4 5 6 1
- C: 2 3 4 5 6 6
- D: 1 2 3 4 5 6
Question 64
What is the expected output of the following code?
- A: [1, 10, 3, 20, 5, 30, 7, 40, 9, 50, 60]
- B: [1, 2, 10, 20, 30, 40, 50, 60]
- C: The code is erroneous.
- D: [10, 2, 20, 4, 30, 6, 40, 8, 50, 60]
Question 65
What is the expected output of the following code?
- A: 2
- B: 1
- C: The code is erroneous.
- D: 3
- E: 4
Question 66
What is the expected output of the following code?
- A: hellopeter
- B: hello@Peter!!
- C: hello@peter!!
- D: None
Question 67
What is the output of the following snippet?
- A: 12
- B: (2, 1)
- C: (1, 2)
- D: 21
That’s the end of your free questions
You’ve reached the preview limit for PCEP-30-02Consider upgrading to gain full access!
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!