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 38 discussion

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

What is the expected output of the following code?

  • A. The code is erroneous.
  • B. 1
  • C. 0
  • D. None
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
hovnival
5 days, 4 hours ago
Selected Answer: C
The given Python code snippet defines an empty tuple and prints its length using the __len__() method. Code: data = () print(data.__len__()) Explanation: data = () initializes an empty tuple. data.__len__() is a method that returns the number of items in the tuple. Since the tuple is empty, the length is 0. Expected Output: 0
upvoted 1 times
...
VinzBetel7
1 week, 4 days ago
Selected Answer: A
the code is erroneous. Correct answer is A
upvoted 1 times
...
Nfyughguygjhg
3 weeks, 1 day ago
Selected Answer: A
it hass to be A!
upvoted 1 times
...
raYda
3 weeks, 3 days ago
Selected Answer: C
C is the correct answer
upvoted 1 times
...
Ameer
3 weeks, 4 days ago
Selected Answer: C
C is the correct answer
upvoted 1 times
...
Dont_Stop_Learning
2 months ago
Selected Answer: A
The correct answer is A
upvoted 2 times
...
christostz03
4 months, 1 week ago
AttributeError: 'tuple' object has no attribute '_len_'
upvoted 1 times
Vano1
1 month, 3 weeks ago
Please try with two underscores instead of one. .__len__ exist.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago