Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Keywords: and, or, not | Boolean Type
Python Data Types
セクション 2.  3
single

single

bookKeywords: and, or, not

メニューを表示するにはスワイプしてください

There are some keywords for Boolean variables: and, or, not. They exist to create more complex expressions. Next we will see how it works with examples.

  • and. If value x = True and value y = True then x and y is equal to True. If either of those is False, then expression becomes False too.
  • or. If x = True or y = True then the expression x or y is equal to True (or both values = True).
  • not If value x is False then the expression, not x evaluates to True . Otherwise, the expression evaluates to False.
Input:
x, y = True, False
print((x or y) == False)

Output:
False
Input:
x, y = True, False
print((x and y) == False)

Output:
True
Input:
x = False
print(not x)

Output:
True
タスク

スワイプしてコーディングを開始

You must fill in the blanks so that the values ​​of all expressions satisfy the conditions specified in the comments.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  3
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt