Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCEP-30-02 All Questions

View all questions & answers for the PCEP-30-02 exam

Exam PCEP-30-02 topic 1 question 41 discussion

Actual exam question from Python Institute's PCEP-30-02
Question #: 41
Topic #: 1
[All PCEP-30-02 Questions]

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

Code:

  • A. sorted(list)
  • B. sort(list)
  • C. list.sort()
  • D. list.sorted()
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
rcptryk
2 days, 16 hours ago
Selected Answer: C
C is correct because the output expectation must come from print(list) not from the print(sorted(list)). you have to write comment before the print which is list.sort() or you have to write list=sorted(list) which is not option
upvoted 1 times
...
mldprasad
5 days, 17 hours ago
Selected Answer: A
list = [2, 7, 1, 4] print(sorted(list)) So A is correct answer. C output is None
upvoted 1 times
...
Vano1
3 weeks, 2 days ago
Selected Answer: C
The correct answer is C. Checked in Python
upvoted 1 times
...
scriptnone
1 month ago
Selected Answer: A
list = [2, 7, 1, 4] print(sorted(list)) So A is correct answer. C output is None
upvoted 1 times
...
SujPractise
1 month, 3 weeks ago
C will return the sorted list [1, 2, 4, 7]
upvoted 2 times
...
christostz03
3 months ago
c is the correct answer
upvoted 2 times
...
Biju1
3 months, 1 week ago
list.sort() will show none
upvoted 2 times
...
Biju1
3 months, 1 week ago
A is correct
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...