Computer Science
Which of the following expressions evaluates to False ?
- not(True) and False
- True or False
- not(False and True)
- True and not(False)
Python Funda
6 Likes
Answer
not(True) and False
Reason —
not(True) and Falseevaluates toFalse and False, which isFalse.True or Falseevaluates toTrue.not(False and True)evaluates tonot(False), which isTrue.True and not(False)evaluates toTrue and True, which isTrue.
Answered By
3 Likes
Related Questions
State True or False:
The Python interpreter handles logical errors during code execution.
Identify the output of the following code snippet:
text = "PYTHONPROGRAM" text = text.replace('PY', '#') print(text)- #THONPROGRAM
- ##THON#ROGRAM
- #THON#ROGRAM
- #YTHON#ROGRAM
What is the output of the expression ?
country = 'International' print(country.split("n"))('I', 'ter', 'atio', 'aI')['I', 'ter', 'atio', 'al']['I', 'n', 'ter', 'n', 'atio', 'n', 'al']Error
What will be the output of the following code snippet ?
message = "World Peace" print(message[-2::-2])