条件分岐やループの制御にbool関数を使って、引数の真偽値を判定すると便利です。 x = input('Enter something: ') if bool(x): print('You entered:', x) else: print('You entered nothing') arr = [1, 2, 3, 0, 4, 5] for x in arr: if bool(x): print(x, 'is True') else: ...