[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

NEW PHONE, WHO DIS!?

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 3
Thread images: 1

File: pyt.png (177KB, 640x453px) Image search: [Google]
pyt.png
177KB, 640x453px
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= Y
is usually equivalent to
X = X op Y
>>
>>61481491
Read the fucking sticky you dumb fuck pynigger
Thread posts: 3
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.