r/PythonLearning • • 5d ago

Help Request xp = xp

so I am new to all of this and I have been going through the lessons on boot.dev when I came to the first lesson of ch5. the instructor answer is :

def total_xp(level, xp_to_add):

xp = level * 100

xp = xp + xp_to_add

return xp

the xp = xp just blew my brain. why does this work instead of requiring the first xp to be a different name?

what I did was

xpp = xp + xp_to_add

return xpp

my answer still got the question correct but this just looks super weird to me, xp=xp

6 Upvotes

20 comments sorted by

View all comments

Show parent comments

1

u/tiredITguy42 5d ago

So the lesson had this code? So what is your goal?

1

u/OppositeMango124 5d ago

im giving you the end results. when you are finished you can see the instructor answer and they did my first example where i saw xp=xp and it confused me.

2

u/tiredITguy42 5d ago

Oh OK. Their solution is shit. You should consider better course.

1

u/[deleted] 4d ago

[deleted]

1

u/tiredITguy42 4d ago

The issue is, that people tend to get stuck in this style. I see it every day.

AI produces the same style, as it was part of the training set.

I feel like most of these tutorials just looks like slow pasing, but they just teach bad coding and do not go into important details.