Python Forum
[split] SyntaxError when trying to execute code on Windows
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] SyntaxError when trying to execute code on Windows
#1
I would be happy to help me.
when I running this code :
print("""
 _    _
| |  | |
| |__| | __ _ _ __   __ _ _ __ ___   __ _ _ __ 
|  __  |/ _' | '_ \ / _' | '_ ' _ \ / _' | '_ \ 
| |  | | (_| | | | | (_| | | | | | | (_| | | | |
|_|  |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
                     __/ |
                    |___/
""")
I accepted this error:
^
Error:
SyntaxError: unexpected character after line continuation character
Reply
#2
your code works for me.
post the full code you have. Sometimes the error may be on the previous line
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
the full code:
import random
print("""
 _    _
| |  | |
| |__| | __ _ _ __   __ _ _ __ ___   __ _ _ __ 
|  __  |/ _' | '_ \ / _' | '_ ' _ \ / _' | '_ \ 
| |  | | (_| | | | | (_| | | | | | | (_| | | | |
|_|  |_|\__,_|_| |_|\__, |_| |_| |_|\__,_|_| |_|
                     __/ |
                    |___/
""")
random.randint(5, 10)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] another problem with code blakeusherremix68 0 378 Dec-23-2024, 11:36 PM
Last Post: blakeusherremix68
  [split] Code help emma1423 1 568 Dec-13-2024, 02:00 PM
Last Post: perfringo
  Windows Disk Cleanup Code Help Needed nal2us2 3 1,012 Jul-19-2024, 04:03 AM
Last Post: deanhystad
  Error on import: SyntaxError: source code string cannot contain null bytes kirkwilliams2049 7 19,258 Aug-03-2023, 06:00 PM
Last Post: Gribouillis
  [split] Explain the python code in this definition Led_Zeppelin 1 1,294 Jan-13-2023, 10:20 PM
Last Post: deanhystad
  Can a program execute code in iPython shell and get result? deanhystad 3 2,694 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  How to Translate a python code written in Mac-OS to Windows? alexanderDennisEnviro500 2 4,077 Jul-31-2021, 08:36 AM
Last Post: Gribouillis
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 3,882 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea
  [split] SyntaxError: invalid syntax Code_X 3 3,716 May-04-2021, 05:15 PM
Last Post: Yoriz
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 5,543 Apr-13-2021, 01:26 PM
Last Post: amirian

Forum Jump:

User Panel Messages

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