I was supposed to make a diamond out of this and I have successfully done so but I have a problem. Here is my code
k = 7
def triangle(k):
a = (2*k) -1
k = 3
for x in range(0,a+1):
if x % 2 != 0:
f = int((a - x)/2)
g = f"{'#'*f}{'*'*x}{'#'*f}"
print(g)
def diamond(k):
a = (2 * k) - 1
k = 3
for x in reversed(range(0, a)):
if x % 2 != 0:
f = int((a - x) / 2)
g = f"{'#' * f}{'*' * x}{'#' * f}"
print(g)
l = f"{triangle(k)}\n{diamond(k)}"
print(l)
Along with the diamond, there are also two 'none' appearing underneath like this in the output..
######*######
#####***#####
####*****####
###*******###
##*********##
#***********#
*************
#***********#
##*********##
###*******###
####*****####
#####***#####
######*######
None
None
How can I print the output without including the none in the output??