Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Grades Code":
#10
(Nov-22-2023, 10:30 PM)rob101 Wrote:
(Nov-22-2023, 09:53 PM)Anthony Wrote: Thank-you for your reply, Your rewritten code is starting to make sense for me.
What is the small "f' in the brackets for?

You are very welcome and I'm pleased that the code does make sense, as that demonstrates that you're learning, and learning fast: there are concepts there that I'm sure will be new to you, such as "f-strings", which brings me to your question.

When you see a string object that is prefixed with f, that's called an "f-string". What this does, is to tell the python interpreter to insert the value of an object into the string. You can have as many of as few insertion points (AKA: "place holders") as you need, and each point is indicated by a brace pair {} into which you place the object that you want to see when said string is interpreted.

Have a read of this tutorial for a much better explanation than I can provide.

I'll have a look at the rest of your needs and post back when I have the chance. In the mean time you should have a go at solving that for yourself, and post back if you hit a wall.
Reply


Messages In This Thread
Grades Code": - by Anthony - Nov-22-2023, 03:58 AM
RE: Grades Code": - by rob101 - Nov-22-2023, 08:05 AM
RE: Grades Code": - by buran - Nov-22-2023, 08:07 AM
RE: Grades Code": - by buran - Nov-22-2023, 08:09 AM
RE: Grades Code": - by rob101 - Nov-22-2023, 08:29 AM
RE: Grades Code": - by perfringo - Nov-22-2023, 12:30 PM
RE: Grades Code": - by rob101 - Nov-22-2023, 01:47 PM
RE: Grades Code": - by Anthony - Nov-22-2023, 09:53 PM
RE: Grades Code": - by rob101 - Nov-22-2023, 10:30 PM
RE: Grades Code": - by Anthony - Nov-23-2023, 02:51 AM
RE: Grades Code": - by Anthony - Nov-23-2023, 02:54 AM
RE: Grades Code": - by Anthony - Nov-23-2023, 09:44 PM
RE: Grades Code": - by buran - Nov-23-2023, 03:59 AM
RE: Grades Code": - by rob101 - Nov-23-2023, 05:37 AM
RE: Grades Code": - by buran - Nov-24-2023, 07:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calculate median for school grades per subject siki 1 2,000 May-10-2021, 11:41 AM
Last Post: jefsummers
  python program that calculat grades of students biligorm 3 2,344 Apr-04-2020, 10:11 AM
Last Post: buran

Forum Jump:

User Panel Messages

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