Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Beginner Coding Help
#1
Hi,

I'm brand new to Python and don't understand what I've done wrong here, could someone please enlighten me?
_______________________________________________________________________________________

Here's my code:

question_know = "How many sides does a square have?"
question = "How many sides does a circle have?"

if question == question_know:
    print("4")

else:
    print(f"I don't know, why not try asking {question_know}")
_______________________________________________________________________________________

Here's my error:

Error:
File "/Users/callumbennett/Dropbox/Mac/Documents/P Projects/HelloWorld/Playground.py", line 8 print(f"I don't know, why not try asking {question_know}") ^ SyntaxError: invalid syntax [Finished in 2.348s]
_______________________________________________________________________________________

Thanks for your time.
Yoriz write Oct-30-2021, 01:47 PM:
Please post all code, output and errors (in their entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply


Messages In This Thread
Beginner Coding Help - by calpro - Oct-30-2021, 01:29 PM
RE: Beginner Coding Help - by Yoriz - Oct-30-2021, 01:56 PM
RE: Beginner Coding Help - by calpro - Oct-30-2021, 01:58 PM
RE: Beginner Coding Help - by Yoriz - Oct-30-2021, 02:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tic-Tac game (Beginner's coding) Shahmadhur13 5 3,178 Aug-29-2020, 08:40 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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