stars

Printing a star instead of a number

How to print a star instead of a number? Question: I need to write a function numbers_around(n, k) that prints the numbers smaller and larger than n in order. Instead of the number n, it should print an asterisk. What I’ve done: def numbers_around(n, k): for n in range((n-k),(n+k+1)): print(n, end=’ ‘) print() numbers_around(15, 3) …

Total answers: 1