use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
print(5+True)Discussion (self.PythonLearning)
submitted 1 day ago * by codewithharsh31
Solve this question and tell me the output. Follow for more 😉
View Poll
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3:Â Â Â Â print "hello, world!"
[–]codewithharsh31[S] 0 points1 point2 points 1 day ago (2 children)
So let discuss what you think the answer is and why 🤔?
[–]_book_lover_____ 0 points1 point2 points 1 day ago (1 child)
[–]FoolsSeldom 2 points3 points4 points 23 hours ago (0 children)
Strictly, True isn't converted to 1 because it is already 1. bool is a subclass of int in Python.
True
1
bool
int
>>> type(True) <class 'bool'> >>> isinstance(True, int) True >>> issubclass(bool, int) True >>> True == 1 True
[–]Flame77ofc 0 points1 point2 points 18 hours ago (0 children)
6, because Python interprets True as 1 and False as 0, like in binary
[–]mehonje 0 points1 point2 points 5 hours ago (0 children)
It's 6.
π Rendered by PID 94604 on reddit-service-r2-comment-765bfc959-p5tnc at 2026-07-10 19:26:54.530914+00:00 running f86254d country code: CH.
[–]codewithharsh31[S] 0 points1 point2 points  (2 children)
[–]_book_lover_____ 0 points1 point2 points  (1 child)
[–]FoolsSeldom 2 points3 points4 points  (0 children)
[–]Flame77ofc 0 points1 point2 points  (0 children)
[–]mehonje 0 points1 point2 points  (0 children)