Can I write multiline strings next to each other instead of one below the other?

Block Letters

I was doing the block letters mini project and I have seen the solutions they used print, but I wanted to use a multiline string to do my solution and my initials are both A but when I add the multiline strings they are not next to each other but one is below the other.

How can I add multiline strings next to each other?

FirstInitial = """
  A  
 A A
A   A
AAAAA
A   A
A   A
A   A 
"""
SecondInitial = FirstInitial
print(FirstInitial + " " + SecondInitial)

image

I don’t think there’s a shortcut to do this (though I’d love to hear otherwise), you’ll probably need to create a new string (or more than one). You’d likely want to break the existing string up using new lines in order to do this.

1 Like

Inspiration from a fellow programmer, so I can’t take credit for this idea, but perhaps a dictionary would be good if you’ve learned of those:

letters = {"a": "  a  \n a a \na   a\naaaaa\na   a\na   a\na   a", "b": "bbbb \nb   b\nb   b\nbbbb \nb   b\nb   b\nb   b\nbbbb, ...}

Personally I might prefer a list and get the index with ord()

Though kinda advanced this might be a fun read. Before it, I had never put any thought into how intricate this project could get. :slightly_smiling_face:

1 Like

I’ve not scrolled to the far end but that must end in “BATMAN!” aye? :wink:

1 Like

Apparently you’re more creative than I :grinning_face_with_smiling_eyes:
I just did a map for the letters a and b

1 Like