Nov-23-2023, 02:51 AM
(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 withf
, 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.