+ 5

Is there any way of printing text art???| Python

Is there a way to print text art without it being messy or smth..? =/ its doesnt paste the spaces in and I hate that

22nd Nov 2017, 7:29 PM
StRix
StRix - avatar
9 ответов
+ 3
Updated my code to use whitespaces instead of underscores. Works exactly as you'd think it should work; no tricks involved. https://code.sololearn.com/cELokx5avLCQ/#py
22nd Nov 2017, 7:47 PM
AgentSmith
+ 6
nvm guys I just pasted it first on my notepad copied it and then pasted it on my code
22nd Nov 2017, 8:12 PM
StRix
StRix - avatar
+ 5
I tried it and spaces still wont appear
22nd Nov 2017, 7:40 PM
StRix
StRix - avatar
+ 3
@James I'm always on PC. I'm honestly amazed at how well everyone here does with having to use their phones. lol I'd die if I had to program from my phone.
22nd Nov 2017, 8:04 PM
AgentSmith
+ 2
https://code.sololearn.com/cELokx5avLCQ/#py ^You can easily do it. print() DOES print whitespaces, but if you're copying/pasting from elsewhere, you'll want to make sure it lines up as you expect it to.
22nd Nov 2017, 7:43 PM
AgentSmith
+ 2
@StRix I finished Jame's example and posted it in Code Playground for you. Check it out, it's how you can easily go about the same thing using a variable instead. Personally, I like his version much better, and if I was a Python programmer, that's the way I'd adopt. You can do a lot more with it and if you were making a text based game, it'd be an ideal solution for many things. For example, you could store a lot of art in text files or in their own class, and easily invoke them to the screen. Also makes copying/pasting easier, using other chars, editing the art, etc... https://code.sololearn.com/cBFbuke2FB4j/#py
22nd Nov 2017, 7:58 PM
AgentSmith
+ 2
@James That sounds possible. On your phone, did you remove the spaces between your double quotes? I had to do that on my end to get your example to work correctly. Also, have the first """ on the top line by itself, and """ on the bottom line by itself, put the ASCI art in between on their own lines.
22nd Nov 2017, 8:08 PM
AgentSmith
+ 2
@James Ah okay, gotcha. Makes sense. I updated my previous reply, but I think you were already typing your reply to it. If you put """ by itself on the top line, and also the bottom line, and just put your ASCI on their own lines in between them, it should line up.
22nd Nov 2017, 8:09 PM
AgentSmith
+ 1
@James Only problem with your " " " is that there is spaces between it, just make it """ in Code Playground and it works like a charm. I posted your example into Code Playground for the OP, and showed how you can use the variable. Hope you don't mind.
22nd Nov 2017, 8:00 PM
AgentSmith