Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Print with """
#4
In Python strings, the backslash "\" is a special character, also called the "escape" character. It is used in representing certain whitespace characters: "\t" is a tab, "\n" is a newline, and "\r" is a carriage return.
Put an r in front of the string to make it a raw string it will then treat the "\" as normal "\".
print("Program 'Game Over' 2.0")
print(r'''
   __________           _______              ____   _____      ___________
  /          |         /       |            /    | /     |    |           |
 /    _______|        /   _    |           /     |/      |    |    _______|
 |   |               /   / |   |          /  /|     /|   |    |   |
 |   |              /   /__|   |         /   /|    / |   |    |   |_____
 |   |    ___      /   ____    |        /   / |___/  |   |    |    _____|
 |   |   |   |    /   /    |   |       /   /         |   |    |   |
 |   |___|   |   /   /     |   |      /   /          |   |    |   |_______
  \         /   /   /      |   |     /   /           |   |    |           |
   \_______/   /___/       |___|    /___/            |___|    |___________|
 
    _________       ___        ___     ___________      _______
   /         \     |   |      /   /   |           |    |       \
  /     _     \    |   |     /   /    |    _______|    |   |\   \
  |    / \    |    |   |    /   /     |   |            |   | \   \
  |    | |    |    |   |   /   /      |   |_____       |   |_/   /
  |    | |    |    |   |  /   /       |    _____|      |        /
  |    | |    |    |   | /   /        |   |            |   |\   \
  |    \_/    |    |   |/   /         |   |_______     |   | \   \
  \           /    |       /          |           |    |   |  \   \
   \_________/     |______/           |___________|    |___|   \___\
   ''')
Another option is to use double "\\"
print("Program 'Game Over' 2.0")
print('''
   __________           _______              ____   _____      ___________
  /          |         /       |            /    | /     |    |           |
 /    _______|        /   _    |           /     |/      |    |    _______|
 |   |               /   / |   |          /  /|     /|   |    |   |
 |   |              /   /__|   |         /   /|    / |   |    |   |_____
 |   |    ___      /   ____    |        /   / |___/  |   |    |    _____|
 |   |   |   |    /   /    |   |       /   /         |   |    |   |
 |   |___|   |   /   /     |   |      /   /          |   |    |   |_______
  \         /   /   /      |   |     /   /           |   |    |           |
   \_______/   /___/       |___|    /___/            |___|    |___________|
 
    _________       ___        ___     ___________      _______
   /         \     |   |      /   /   |           |    |       \\
  /     _     \    |   |     /   /    |    _______|    |   |\   \\
  |    / \    |    |   |    /   /     |   |            |   | \   \\
  |    | |    |    |   |   /   /      |   |_____       |   |_/   /
  |    | |    |    |   |  /   /       |    _____|      |        /
  |    | |    |    |   | /   /        |   |            |   |\   \\
  |    \_/    |    |   |/   /         |   |_______     |   | \   \\
  \           /    |       /          |           |    |   |  \   \\
   \_________/     |______/           |___________|    |___|   \___\\
   ''')
An extra blank space in place of the doubled "\" will also work
Reply


Messages In This Thread
Print with """ - by Greatstillness - May-30-2019, 05:48 PM
RE: Print with """ - by ichabod801 - May-30-2019, 06:15 PM
RE: Print with """ - by Greatstillness - May-31-2019, 11:22 AM
RE: Print with """ - by Yoriz - May-31-2019, 12:35 PM
RE: Print with """ - by Greatstillness - May-31-2019, 12:45 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020