Free Python Institute PCEP-30-02 Exam Braindumps (page: 12)

Which one of the lines should you put in the snippet below to match the expected output?
Expected output:

Code:

  1. sorted(list)
  2. sort(list)
  3. list.sort()
  4. list.sorted()

Answer(s): C



Which of the following sentences are true about the code? (Choose two.)

  1. nums and vals are different lists
  2. vals is longer than nums
  3. nums and vals are different names of the same list
  4. nums and vals have the same length

Answer(s): C,D



The second assignment:

  1. extends the list
  2. doesn't change the list's length
  3. shortens the list

Answer(s): B



What is the expected output of the following code?

  1. efg
  2. abc
  3. def
  4. The code is erroneous.
  5. abcde
  6. None of the above.

Answer(s): A



Viewing page 12 of 99
Viewing questions 45 - 48 out of 450 questions



Post your Comments and Discuss Python Institute PCEP-30-02 exam prep with other Community members:

PCEP-30-02 Exam Discussions & Posts