r/PythonLearning • u/Reh4n07_ • Apr 05 '26
Help Request Can Anyone Please Explain The error :/

I recently started learning Python and have been experimenting with variables to better understand how they work. However, I ran into an error that I can't figure out.
Could someone please explain why this error is occurring and how I solve it? Any insights would be greatly appreciated!
Btw:- Anyone one wanna Become my programming friend so that i can share my problem with?
1
Upvotes
3
u/Anpu_Imiut Apr 05 '26
I have no clue from where you learned this kind of syntax (it is unpythonic) Let me share what i know from strings:
Strings are immutable. Changing a char inplace throws an error.
a = a+ "r" creates a new string. In your case c=a+b would create a new string of both string connected without a whitspace. 3.Print(x, y, z) prints those strings in order but without control. If you want to have control you need to use formatted strings f"" You add variables to f-strings by enclosing them with {}. Those areas inside are a normal code line. You could do sth. like a+b/c inside for 3 numbers a, b, c.
Usefull string methods to look at: join, split, replace, lower
Use 3x" ... 3x" for strings that break over lines. But be carefull with spaces in those.
GL buddy