#π Digit calculation
45 messages Β· Page 1 of 1 (latest)
@calm bloom
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Please react with β
to upload your file(s) to our paste bin, which is more accessible for some users.
you could remove the commas and then get the length of the string
!e
print(len("80,995,899".replace(",", "")))
:white_check_mark: Your 3.12 eval job has completed with return code 0.
8
e.g.
Right now the file looks like this.
How do I even calculate it?
Like where do I write the code.
well then
you need to read the text file into a string.
e.g
>>> with open("/var/folders/b0/_p0c_57s5n90cy4njdgd8vhw0000gq/T/x/message.txt") as inf:
... numbers = inf.read()
... print(len(numbers.replace(",", "")))
...
10
hmmm yeah, I figured we'd need to use open here.
Okay one moment.
Do I need to import anything, btw?
no
okay.
this is homework, isn't it
how much python u know 
Well uh
I made a rock paper scissors bot
with
well not bot
just code
2 real people playing it.
That's probably my biggest achievement so far.
Okay it worked.
Thanks!
!close
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.