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

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 47 discussion

Actual exam question from Python Institute's PCAP
Question #: 47
Topic #: 1
[All PCAP Questions]

How many stars (*) does the following snippet print?

  • A. the code is erroneous
  • B. five
  • C. three
  • D. four
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
macxsz
2 years, 7 months ago
Selected Answer: D
answer: D. four
upvoted 1 times
...
arohera
2 years, 8 months ago
Selected Answer: D
It will be D as first the value is 3 so a star will be printed, then one for 2 and 1 each, then the value will be 0 so it will go in the else statement and print one start, so total 4 stars
upvoted 3 times
...
cgranadillo
3 years, 10 months ago
I just run this script using this console: https://www.programiz.com/python-programming/online-compiler/ Result was 4 starts Answer is D
upvoted 4 times
...
SanjiDiableJambe
3 years, 10 months ago
i dont know whats wrong with these answers but its A. '+=', '-=' , '*=' , '/=' are not supported in python
upvoted 1 times
arohera
2 years, 8 months ago
they all are supported in python
upvoted 2 times
...
...
pypaul
4 years ago
C. Will print 3 stars
upvoted 2 times
sadako11
4 years ago
D. 4 stars. Please before answering try running the code first. Maybe u are forgetting that after the while loop finishes the else: print("*") will execute.
upvoted 8 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 ...