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

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

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 (?) , you can switch to a simple comment.
Switch to a voting comment New
macxsz
1 year, 11 months ago
Selected Answer: D
answer: D. four
upvoted 1 times
...
arohera
2 years, 1 month 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, 2 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, 3 months ago
i dont know whats wrong with these answers but its A. '+=', '-=' , '*=' , '/=' are not supported in python
upvoted 1 times
arohera
2 years, 1 month ago
they all are supported in python
upvoted 2 times
...
...
pypaul
3 years, 5 months ago
C. Will print 3 stars
upvoted 2 times
sadako11
3 years, 5 months 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 ...