How many stars (*) does the following snippet print?
How many stars (*) does the following snippet print?
D
I just run this script using this console: https://www.programiz.com/python-programming/online-compiler/ Result was 4 starts Answer is 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
C. Will print 3 stars
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.
answer: D. four
i dont know whats wrong with these answers but its A. '+=', '-=' , '*=' , '/=' are not supported in python
they all are supported in python