[Solved]Write Function Called Printstars Function Receives Parameter Containing Integer Value Para Q37019584
Write a function called printStars. The function receives aparameter containing an integer value. If the parameter ispositive, the funciton prints (to standard output) the given numberof asterisks. Otherwise the function does nothing. The functiondoes not return a value. Thus, if printStars(8) is called, ********(8 asterisks) will be printed. The function must not use a loop ofany kind (for, while, do-while) to accomplish its job. Instead, itshould examine its parameter, returning if the parameters value isnot positive. If the parameter is positive, it:
- prints a single asterisk (and no other characters)
- then crecursively calls itself to print the remainingasterisks
This is what I got, but it says my standard output is incorrectand starcount was modified.
def printStars(n):
if n>0:
print (‘*’, end=””)
printStars(n-1)
starCount = 10
printStars(starCount)
Expert Answer
Answer to Write a function called printStars. The function receives a parameter containing an integer value. If the parameter is p… . . .
OR

