DEV Community 👩‍💻👨‍💻

Discussion on: Daily Challenge #2 - String Diamond

Collapse
jasman7799 profile image
Jarod Smith
print((lambda maxStars = int(input("Star Count: ")) : "Can't be a star =(" if not maxStars % 2 else "".join(map(lambda i: "".join([" "]*(int((maxStars - ((i+1) * 2 - 1 if (i+1) * 2 - 1 <= maxStars else (maxStars-(i+1) + 1)*2 -1))/2)) + ["*"]*((i+1) * 2 - 1 if (i+1) * 2 - 1 <= maxStars else (maxStars-(i+1) + 1)*2 -1)) +"\n", range(maxStars))))())

one line functional python, why I dunno.