meta
meta copied to clipboard
Tag: `!if-else`
The documentation for the if statement given by the !docs command provides the grammatical usage and is not very helpful for trying to understand the usage.
Maybe there could be some dedicated tags for them?
I've written a suggestion explanation for a dedicated !if-else tag here. This is just how I might explain it. Maybe it should be simplified, but I'll leave it to the pros.
if condition:
# condition can be a variable or expression.
# Ex. if condition > 0:
print('condition is True'.)
elif condition2:
# elif is optional and can be used to test the same condition
# or another condition.
print('condition is False, but condition2 is True.')
else:
# The default action if the previous conditions are False
print('Both conditions were False.')
If you are interested in writing a tag, you can open an issue for the tag addition and making a pull request after the issue has been approved.
The problem of the doc command fetching the Django template syntax for if-else will need some digging and investigation.
The django/python docs conflict has been solved in python-discord/bot#1606. I've updated your issue to reflect the tag suggestion.