Python Forum
print(f"{person}:") SyntaxError: invalid syntax when running it
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print(f"{person}:") SyntaxError: invalid syntax when running it
#5
(Nov-03-2020, 06:36 PM)Axel_Erfurt Wrote: you need to use python >= 3.6 for f-strings
Did you mean I need to install Python 3.6?
I have IDLE 3.8.3 , pycharm 2020.1.4 (communitiy edition) and Visual studio code Version: 1.50.1 installed in MacBook macos sierra 10.12. The default python is 2.7.10.

Today I just reinstalled IDLE 3.8.3 and removed the 3.9 version because I got an internal error of pygame when I wanted to play a game. I ran the code in IDLE. So I was able to run the code and play the game using pygame again after removing IDLE 3.9 and reinstalling IDLE 3.8.3.

I'm just very nervous if I need to install python 3.6 as you suggested, because it sounds like to me I have to remove IDLE 3.8.3 again and that would mean I might encounter the same error again. And I suppose I might erase the NumPy, scikit-learn, TensorFlow, Keras that I just installed them. And maybe I might lose other python modules/libraries too.

Forgive me if I'm wrong about it.
Reply


Messages In This Thread
RE: print(f"{person}:") SyntaxError: invalid syntax when running it - by AryaIC - Nov-03-2020, 07:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Making a Class Person ? Kessie1971 3 1,261 Apr-23-2023, 05:20 PM
Last Post: deanhystad
  Invalid syntax Slome 2 2,083 May-13-2022, 08:31 PM
Last Post: Slome
  Invalid syntax error, where? tucktuck9 2 3,525 May-03-2020, 09:40 AM
Last Post: pyzyx3qwerty
  How can create class Person :( Azilkhan 1 2,044 Nov-21-2019, 08:12 AM
Last Post: DeaD_EyE
  Invalid syntax defining a dictionary? ep595 6 5,305 Nov-19-2019, 08:06 PM
Last Post: ThomasL
  Syntax Error: Invalid Syntax in a while loop sydney 1 4,177 Oct-19-2019, 01:40 AM
Last Post: jefsummers
  [split] Please help with SyntaxError: invalid syntax Mason 1 2,279 Apr-28-2019, 06:58 PM
Last Post: Yoriz
  SyntaxError: Invalid syntax in a while loop ludegrae 3 14,977 Dec-18-2018, 04:12 PM
Last Post: Larz60+
  SyntaxError: invalid syntax at run .py tuxo9999 10 7,601 Aug-23-2018, 03:58 PM
Last Post: Axel_Erfurt
  Homework: Invalid syntax using if statements chehortop 3 3,762 Mar-01-2018, 04:38 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

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