CREATE A HEART IN PYTHON

The love heart I designed was made in Python which made it innovative and the best part is the code is very simple to understand. You can just edit this lines and make your own personalized love heart to your valentine or you can even modify my idea and come up with a new idea altogether.

SOURCE CODE:

print(‘\n’.join([”.join([(‘Love'[(x-y) % len(‘Love’)] if ((x0.05)2+(y0.1)2-1)3-(x0.05)2(y0.1)*3 <= 0 else ‘ ‘) for x in range(-30, 30)]) for y in range(30, -30, -1)]))

This is a one line code in which you can design a heart in a attractive and simple way.

OUTPUT:

Leave a comment

Design a site like this with WordPress.com
Get started