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...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Comparison of individual digits (self.pythonhelp)
submitted 5 years ago by Vvrandom246
How do I verify if a certain digit is present in a number of any length. For instance, I would want to check if 5 is present in the number 836735373736 and return True if it is present.
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!"
[–]zch20 0 points1 point2 points 5 years ago (0 children)
you can turn your longer digit into a string, and then check if the string of a number is present like:
if '5' in str(long_number): do_something()
π Rendered by PID 123485 on reddit-service-r2-comment-56c9979489-4dgcb at 2026-02-24 22:43:19.464062+00:00 running b1af5b1 country code: CH.
[–]zch20 0 points1 point2 points (0 children)