A small tool to view real-world ActivityPub objects as JSON! Enter a URL
or username from Mastodon or a similar service below, and we'll send a
request with
the right
Accept
header
to the server to view the underlying object.
{
"@context": [
"https://join-lemmy.org/context.json",
"https://www.w3.org/ns/activitystreams"
],
"type": "Page",
"id": "https://lemm.ee/post/57744910",
"attributedTo": "https://lemm.ee/u/milon",
"to": [
"https://programming.dev/c/python",
"https://www.w3.org/ns/activitystreams#Public"
],
"name": "Why can't I use the '|' bitwise operator in this statement?",
"cc": [],
"content": "<p><code>if coin == 25 | 10 | 5:</code></p>\n<p>If I replace the ‘|’ with ‘or’ the code runs just fine. I’m not sure why I can’t use ‘|’ in the same statement.</p>\n<p>Doing the following doesn’t work either:</p>\n<p><code>if coin == 25 | coin == 10 | coin == 5:</code></p>\n<p>I know bitwise operators can only be used with integers, but other then that is there another difference from logical operators?</p>\n",
"mediaType": "text/html",
"source": {
"content": "`if coin == 25 | 10 | 5:`\n\nIf I replace the '|' with 'or' the code runs just fine. I'm not sure why I can't use '|' in the same statement.\n\nDoing the following doesn't work either:\n\n`if coin == 25 | coin == 10 | coin == 5:`\n\nI know bitwise operators can only be used with integers, but other then that is there another difference from logical operators?",
"mediaType": "text/markdown"
},
"attachment": [],
"sensitive": false,
"published": "2025-03-09T07:41:52.735537Z",
"updated": "2025-03-09T07:53:44.922215Z",
"audience": "https://programming.dev/c/python",
"tag": [
{
"href": "https://lemm.ee/post/57744910",
"name": "#python",
"type": "Hashtag"
}
]
}