Hey I was wondering if someone could explain something to me because I'm still new to the coding thing.
here I have some basic RPG alignment code but the one I made was crude and bloated so someone made it smoother and trimmed off the extra nonsense. unfortunately even though it works I don't quite understand why a certain part of it works so I was hoping someone could explain it to me as if I was 4 on a why it works.
good_evil_level = 0
lawful_chaotic_level = 0
def player_alignment_update():
if lawful_chaotic_level > 0:
player_alignment = "lawful"
elif lawful_chaotic_level < 0:
player_alignment = "chaotic"
else:
player_alignment = "neutral"
# I'm having specific trouble here
# Why are there pluses what do they do
if good_evil_level > 0:
player_alignment += " good"
elif good_evil_level < 0:
player_alignment += " evil"
elif good_evil_level == 0 and player_alignment != "neutral":
player_alignment += " neutral"
print("You are " + player_alignment)
player_alignment_update()
X op= Yis usually equivalent toX = X op Y
>>61481491
Read the fucking sticky you dumb fuck pynigger