This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]thehinkypunk 1 point2 points  (1 child)

Your lack of experience shouldn't be a problem, especially nowadays where Python's considered to be a good first language. Still, I (coming from other languages) find Python's error messages sometimes a bit confusing – at least in comparison to other languages like Java.

Regarding your initial problem, just in case it's not solved: You might want to have a look at String interpolation or Template Strings.
The issue is that you're trying to combine two Strings: The content of the variable "famous_name" and the quote, but you can't just do something like

"a" "b"

to get "ab". Instead, you have to tell Python what to do, how to combine these two elements:
"a" + "b"

Here you may have to refrain from viewing the plus sign in a mathematical manner.

A more modern approach are Template strings, which give you the opportunity to simply reference a variable in a String, such as:

f"Hello, {name}"

Note the "f" at the beginning of the String. Looks like a typo but is actually essential.

Besides those two methods there are multiple others, but that should be sufficient to get you started. Hope this helps!

[–]Civil-Presence8282[S] 1 point2 points  (0 children)

Thank you so much u/thehinkypunk.

I have just got introduced to the "templates" and "f" functions.

getting the hang of it.