I have a loop which calculates all the prime numbers. The calculation is good but I can't figure out how to print the hash symbols before the number. For example, here is the code I have:
for num in range(MIN, rangeNumber + 1):
# Print all prime numbers
if num > 1:
for i in range(2, num):
if (num % i) == 0:
break
else:
print(num)
I am trying to figure out how I can print the #
sign before the numbers.
Here is the output that is expected:
How can I create the for
loop?