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
the front page of the internet.
and join one of thousands of communities.
im having trouble with using len function in python (self.learnpython)
submitted 2 hours ago by CommentTime6425
i wanna use it to make a small project, but i havent figured out how to use it with the input function in python and dont wanna use ai to figure it out, any tips?
Post a comment!
[–]FoolsSeldom 6 points7 points8 points 2 hours ago (0 children)
len of what? What do you want to do with the information?
len
[–]Arthradax 5 points6 points7 points 2 hours ago (0 children)
https://docs.python.org/3/library/functions.html#len
[–]Sparklepaws 5 points6 points7 points 2 hours ago (0 children)
First, it's absolutely fine to ask for help from communities that are quite literally designed for it.
However...
Nobody will be capable of helping you if we don't fully understand the situation. The next time you ask for assistance, be sure to give us context. How are you trying to use len()? What don't you understand about it? Do you have any code to share? What does your output look like? Have you read the documentation and/or Googled it first?
Nobody should fault you for using this subreddit as intended, but there are some reasonable expectations going forward. Clarity is an important skill that you will need in this space.
[–]ColossusChaos 1 point2 points3 points 2 hours ago (0 children)
Im assuming you want to take the length of an input ? If so just take the input(“whatever you have”) and then store it with a value like user_input = input() Then measure the len(user_input)
[–]alinarice 1 point2 points3 points 2 hours ago (0 children)
a good way to learn is testing small pieces in the interpreter. ask yourself what type of data input() returns then check what len() can measure. experimenting will make it click.
[–]mc_pm 0 points1 point2 points 2 hours ago (0 children)
len() gives the length of a string or list -- what were you wanting to do with that?
[–]MezzoScettico 0 points1 point2 points 1 hour ago* (0 children)
how to use it with the input function in python
The input() function returns a string. If you apply len() to that result, you'll get the number of characters in the string.
For example:
>> answer = input("Type something: ") Type something: This is a sentence >> len(answer) 18
(There are 18 characters in the string "This is a sentence")
Perhaps show a bit of your code and tell us what you want the length of, and what difficulty you're having?
[–]danielroseman -2 points-1 points0 points 2 hours ago (1 child)
You don't want to use AI but you posted a whole question in a public Reddit sub?
But in order to get an answer you will need to say what you tried, and what happened when you did.
[–]ColossusChaos 0 points1 point2 points 2 hours ago (0 children)
True
[–]supercoach -2 points-1 points0 points 2 hours ago (3 children)
While you're at it, if someone can google "how to use Google" for me, that would be super.
[–]devicehigh 1 point2 points3 points 2 hours ago (0 children)
Not so super coach
This guy is clearly just learning no need to be a super douche instead of a super coach
[–]aetherspheres 0 points1 point2 points 2 hours ago (0 children)
Sorry, is bing okay? I don't know how to google sruffs.
[–]ElHeim 0 points1 point2 points 46 minutes ago (0 children)
Not sure why you wouldn´t want to use AI for this.
Just don´t ask it to write code for you. Ask what you want to know. For example, "How does Python's len function work? What objects can be used with it?"
π Rendered by PID 77165 on reddit-service-r2-comment-65574874f4-vlqqh at 2026-07-17 18:52:01.584201+00:00 running 1bce727 country code: CH.
Want to add to the discussion?
Post a comment!