isdark()
is a function with no return
statement, so it returns None by default. So dark
never evaluates to true.
You're confusing yourself by using the same variable in two different ways. Here's how I would do it:
dark = True
def isdark():
return dark
if isdark():
print('bt')
else:
print('dasd')
or more simply:
isdark = True
if isdark:
print('bt')
else:
print('dasd')
or even more simply:
isdark = True
print('bt' if isdark else 'dasd')