aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Xithrius <[email protected]>2021-02-28 13:16:21 -0800
committerGravatar GitHub <[email protected]>2021-02-28 13:16:21 -0800
commitf040a2700cdb80f95b05587048da4cd681e077cd (patch)
tree9d8eb5cce41f4ad498bb60ee721e948afbf80d97
parentMerge pull request #1438 from python-discord/plural-events (diff)
parentCreate comparison.md (diff)
Merge pull request #1439 from python-discord/comparison-tag
Add a tag to explain a common error with substituting `=` and `==`.
-rw-r--r--bot/resources/tags/comparison.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/bot/resources/tags/comparison.md b/bot/resources/tags/comparison.md
new file mode 100644
index 000000000..12844bd2f
--- /dev/null
+++ b/bot/resources/tags/comparison.md
@@ -0,0 +1,12 @@
+**Assignment vs. Comparison**
+
+The assignment operator (`=`) is used to assign variables.
+```python
+x = 5
+print(x) # Prints 5
+```
+The equality operator (`==`) is used to compare values.
+```python
+if x == 5:
+ print("The value of x is 5")
+```