Python Forum
Can't figure out the syntax error, relatively simple code
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't figure out the syntax error, relatively simple code
#3
You used this: print("Realf:'Shar, what ride you wanna go on after we eat?'"
When it should be this: print("Realf:\'Shar, what ride you wanna go on after we eat?\'")
There is a missing parentheses at the end of the string, and the backslashes (\) before the single quotes (') are necessary. Otherwise, Python thinks the string ends when it hasn't finished yet.
Reply


Messages In This Thread
RE: Can't figure out the syntax error, relatively simple code - by MasterGame - Jul-08-2018, 03:38 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple code not working properly tmv 2 558 Feb-28-2025, 09:27 PM
Last Post: deanhystad
  POST Syntax error amplay 0 671 Aug-07-2024, 02:43 PM
Last Post: amplay
  is this really a syntax error? Skaperen 4 1,684 May-25-2024, 07:31 AM
Last Post: snippsat
  World Clock syntax error OscarBoots 1 1,142 May-03-2024, 05:20 AM
Last Post: snippsat
  Help with simple code JacobSkinner 1 1,391 Mar-18-2024, 08:08 PM
Last Post: deanhystad
  Syntax error for "root = Tk()" dlwaddel 15 6,809 Jan-29-2024, 12:07 AM
Last Post: dlwaddel
Photo SYNTAX ERROR Yannko 3 1,366 Jan-19-2024, 01:20 PM
Last Post: rob101
  I have a code which is very simple but still I cannot detect what's wrong with it max22 1 1,302 Nov-07-2023, 04:32 PM
Last Post: snippsat
  Syntax error while executing the Python code in Linux DivAsh 8 5,265 Jul-19-2023, 06:27 PM
Last Post: Lahearle
  Code is returning the incorrect values. syntax error 007sonic 6 3,079 Jun-19-2023, 03:35 AM
Last Post: 007sonic

Forum Jump:

User Panel Messages

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