Python Forum
Wrong output from script mode
Thread Rating:
  • 3 Vote(s) - 3.67 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wrong output from script mode
#8
# Game Over - Version 2
# Demonstrates the use of quotes in string

print("Program 'Game Over' 2.0")

print("Same", "message", "as before")

print("Just",
      "a bit",
      "bigger")

print("Here", end=" ")
print("it is...")

print(
                r"""
                 _____       ___       ___  ___   _____
                /  ___|     /   |     /   |/   | |  ___|
                | |        / /| |    / /|   /| | | |___
                | |  _    / ___ |   / / |__/ | | |  ___|
                | |_| |  / /  | |  / /       | | | |___
                \_____/ /_/   |_| /_/        |_| |_____|
                 _____   _     _   _____   _____
                /  _  \ | |   / / |  ___| |  _  \
                | | | | | |  / /  | |___  | |_| |
                | | | | | | / /   |  ___| |  _  /
                | |_| | | |/ /    | |___  | | \ \
                \_____/ |___/     |_____| |_|  \_\

                """
              )

input("\n\Press the enter key to exit.")
Look at r""" raw string added in your print function.
This fix your escape character problem with output.
Output:
Program 'Game Over' 2.0 Same message as before Just a bit bigger Here it is... _____ ___ ___ ___ _____ / ___| / | / |/ | | ___| | | / /| | / /| /| | | |___ | | _ / ___ | / / |__/ | | | ___| | |_| | / / | | / / | | | |___ \_____/ /_/ |_| /_/ |_| |_____| _____ _ _ _____ _____ / _ \ | | / / | ___| | _ \ | | | | | | / / | |___ | |_| | | | | | | | / / | ___| | _ / | |_| | | |/ / | |___ | | \ \ \_____/ |___/ |_____| |_| \_\
Reply


Messages In This Thread
Wrong output from script mode - by st3m0n - May-25-2018, 10:42 PM
RE: Wrong output from script mode - by Larz60+ - May-26-2018, 12:17 AM
RE: Wrong output from script mode - by st3m0n - May-26-2018, 01:10 PM
RE: Wrong output from script mode - by Larz60+ - May-26-2018, 01:20 PM
RE: Wrong output from script mode - by st3m0n - May-26-2018, 01:28 PM
RE: Wrong output from script mode - by Larz60+ - May-26-2018, 01:30 PM
RE: Wrong output from script mode - by st3m0n - May-26-2018, 02:18 PM
RE: Wrong output from script mode - by snippsat - May-26-2018, 04:32 PM
RE: Wrong output from script mode - by st3m0n - May-26-2018, 04:48 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Receiving this error in my "response" and causes script to return wrong status cubangt 18 2,372 Aug-13-2023, 12:16 AM
Last Post: cubangt
  Compiles Python code with no error but giving out no output - what's wrong with it? pythonflea 6 1,726 Mar-27-2023, 07:38 AM
Last Post: buran
  Python Pandas Syntax problem? Wrong Output, any ideas? Gbuoy 2 995 Jan-18-2023, 10:02 PM
Last Post: snippsat
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,788 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  Os command output in variable shows wrong value paulo79 2 1,592 Apr-09-2022, 03:48 PM
Last Post: ndc85430
  Real-Time output of server script on a client script. throwaway34 2 2,144 Oct-03-2021, 09:37 AM
Last Post: ibreeden
  things that work in terminal mode but not in sublime mode alok 4 2,974 Aug-11-2021, 07:02 PM
Last Post: snippsat
  For loops returning wrong output Nighthound21 1 2,015 May-03-2021, 03:43 AM
Last Post: deanhystad
  print function output wrong with strings. mposwal 5 3,258 Feb-12-2021, 09:04 AM
Last Post: DPaul
  Python script to summarize excel tables, then output a composite table? i'm a total n surfer349 1 2,451 Feb-05-2021, 04:37 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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