Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
New Sketch
By
Fathima Nourin S.U
Run
import math n = 10 message = " wanna lIVE? lIVE with ME!! " print_message = 3 if (len(message) % 2 != 0): message += " " for a in range(n): for b in range(4 * n + 1): distance1 = math.sqrt(pow(a - n, 2) + pow(b - n, 2)) distance2 = math.sqrt(pow(a - n, 2) + pow(b - 3 * n, 2)) if (distance1 < n + 0.5 or distance2 < n + 0.5): print("S", end = "") else: print(" ", end = "") print() for a in range(1, 2 * n): for b in range(a): print(" ", end = "") for b in range(4 * n + 1 - 2 * a): if (a >= print_message - 1 and a <= print_message + 1): point = b - (4 * n - 2 * a - len(message)) // 2 if (point < len(message) and point >= 0): if (a == print_message): print(message[point], end = "") else: print(" ", end = "") else: print("S", end = "") else: print("S", end = "") print()
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login