We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Python
- Strings
- Alphabet Rangoli
- Discussions
Alphabet Rangoli
Alphabet Rangoli
Sort by
recency
|
1364 Discussions
|
Please Login in order to post a comment
I threw in some math to reflect the structure of the diamond. Could probably consolidate parts of it, but I like how it shows where each part comes from.
def print_rangoli(n):
if name == 'main': n = int(input()) print_rangoli(n)
entre vouz
def print_rangoli(n):
if name == 'main': n = int(input()) print_rangoli(n)
def print_rangoli(size): # your code goes here width = (size * 4) -3 alphabet = "abcdefghijklmnopqrstuvwxyz" substr = alphabet[0:size][::-1] #reversed substring eg. edcba
What a creative task! Alphabet rangolis are such a beautiful way to blend art and mathematics, and it's amazing how the patterns evolve based on the given size. Each design, from smaller to larger sizes, reflects the symmetry and balance of the letters in the alphabet, Ekbet71