# Apply De Morgan's Laws

Canonical URL: <https://datadriven.io/problems/apply-de-morgans-laws-given-a-true-and-b-false-show-t-0b3d0e83>

Domain: Python · Difficulty: medium

## Problem

Apply De Morgan's Laws. Given a = True and b = False, show that 'not (a and b)' equals 'not a or not b', and 'not (a or b)' equals 'not a and not b'. Print each pair of equivalent results.

## Related

- [All practice problems](https://datadriven.io/problems)
- [Mock interview mode](https://datadriven.io/interview/apply-de-morgans-laws-given-a-true-and-b-false-show-t-0b3d0e83)
- [Python Interview Questions](https://datadriven.io/python-interview-questions)
- [Data Engineering Interview Prep Guide](https://datadriven.io/data-engineer-interview-prep)
- [Daily Challenge](https://datadriven.io/daily)

---

Source: DataDriven (https://datadriven.io). 100% free data engineering interview prep. Live code execution against Postgres 16, Python 3.11, and Spark sandboxes. No paywall, no premium tier, no signup gate.