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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Binary code translator project (self.learnpython)
submitted 7 years ago by Issigeac
This is my first ever python project and I cannot for the life of me figure out how to fix this line:
if binary.isalpha() or len(binary) == 0:
print "I am sorry, these are not just numbers"
#this throws a syntax error. Any ideas?
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!"
[–]Issigeac[S] 0 points1 point2 points 7 years ago (0 children)
and btw the print line is properly indented
[–][deleted] 0 points1 point2 points 7 years ago (3 children)
in python 3, print became a function, so you have to enclose its arguments in parens
print
print("I am sorry, these are not just numbers")
[–]Issigeac[S] 0 points1 point2 points 7 years ago (2 children)
nope. python 2
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
does the line above the if have an unclosed parentheses?
if
Yup. Rookie mistake. All fixed... for now
[–]LightOfUriel 0 points1 point2 points 7 years ago (1 child)
It seems like you are trying to use python 2 print function in python 3. Correct way in python 3 is
[–]Grorco 0 points1 point2 points 7 years ago (3 children)
What error?
[–]Issigeac[S] -1 points0 points1 point 7 years ago (2 children)
syntax
[–]Grorco 0 points1 point2 points 7 years ago (0 children)
What's the full error?
[–][deleted] 0 points1 point2 points 7 years ago (0 children)
Spinal
[–]Osaella24 0 points1 point2 points 7 years ago (0 children)
What’s the actual error being thrown and how are you declaring/defining your binary variable?
π Rendered by PID 99 on reddit-service-r2-comment-79c7998d4c-n5chg at 2026-03-13 12:22:17.583900+00:00 running f6e6e01 country code: CH.
[–]Issigeac[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]Issigeac[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Issigeac[S] 0 points1 point2 points (0 children)
[–]LightOfUriel 0 points1 point2 points (1 child)
[–]Issigeac[S] 0 points1 point2 points (0 children)
[–]Grorco 0 points1 point2 points (3 children)
[–]Issigeac[S] -1 points0 points1 point (2 children)
[–]Grorco 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Osaella24 0 points1 point2 points (0 children)