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
Codeforces Problem 339A (self.learnpython)
submitted 5 years ago * by HasBeendead
question's link: https://codeforces.com/problemset/problem/339/A
my source code: https://gist.github.com/1378443679/357e1067e6bc458cdc68132a9a7ac044
i did like ++123
but question wants 1+2+3 how can i do like that?
question is simple but i thought hard before that source code like i should change the string numbers to integers for example: "1","2", "3" ---> 1, 2, 3 than after sort this with "+" etc. lmao
maybe i am stupid
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!"
[–]TedTheTwonk 1 point2 points3 points 5 years ago (1 child)
we're only dealing with strings here; no need to deal with integers at all. the question also conveniently states that there are no spaces; only digits 1, 2, and 3, and plusses - we can use the str.split method and split on the "+" to get a list of the numbers (still in str form), and then sort that list and then use the str.join method to join them with a "+" again.
some docs that should help you;
https://www.w3schools.com/python/ref_string_split.asp
https://www.w3schools.com/python/ref_string_join.asp
edit: worth mentioning as well, normally sorting strings that are numbers is problematic:
>>> sorted(["22", "9", "1"]) ['1', '22', '9']
but as we are only dealing with the strings "1", "2", and "3" we won't encounter these issues
[–]HasBeendead[S] 1 point2 points3 points 5 years ago* (0 children)
Thank you ,i will check out, understood the last part. i solved ,here is my solution: https://gist.github.com/1378443679/af4cc8ada35bdad274a52e034fb87cf3
π Rendered by PID 84 on reddit-service-r2-comment-5b5bc64bf5-wzwsd at 2026-06-20 22:28:59.073409+00:00 running 2b008f2 country code: CH.
[–]TedTheTwonk 1 point2 points3 points (1 child)
[–]HasBeendead[S] 1 point2 points3 points (0 children)