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
  Error on import: SyntaxError: source code string cannot contain null bytes kirkwilliams2049 7 6,143 Aug-03-2023, 06:00 PM
Last Post: Gribouillis
  [split] Explain the python code in this definition Led_Zeppelin 1 709 Jan-13-2023, 10:20 PM
Last Post: deanhystad
  Can a program execute code in iPython shell and get result? deanhystad 3 1,660 Jun-17-2022, 03:45 AM
Last Post: Larz60+
  How to Translate a python code written in Mac-OS to Windows? alexanderDennisEnviro500 2 2,636 Jul-31-2021, 08:36 AM
Last Post: Gribouillis
Sad SyntaxError: from simple python example file from mind-monitor code (muse 2) warmcupoftea 4 2,749 Jul-16-2021, 02:51 PM
Last Post: warmcupoftea
  [split] SyntaxError: invalid syntax Code_X 3 2,702 May-04-2021, 05:15 PM
Last Post: Yoriz
  [split] Kera Getting errors when following code example Image classification from scratch hobbyist 3 4,546 Apr-13-2021, 01:26 PM
Last Post: amirian
  Using a .bat file to execute simple anaconda commands in Windows 10 gacg1 0 4,619 Nov-30-2020, 03:24 PM
Last Post: gacg1
  "SyntaxError: invalid syntax" running code in Doing Math With Python b saucerdesigner 2 2,700 Nov-03-2020, 04:23 PM
Last Post: saucerdesigner
  [split] Python code help sairam17519 3 2,570 Sep-10-2020, 01:44 PM
Last Post: sairam17519

Forum Jump:

User Panel Messages

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