#๐Ÿ”’ how to add a period after the second number in python

18 messages ยท Page 1 of 1 (latest)

unreal mist
#

So basically if the input is 200 it becomes 20.0 or if it 255 it becomes 25.5

flat nymphBOT
#

@unreal mist

Python help channel opened

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.

marsh pulsar
#

!e

num = 255
print(num / 10)
flat nymphBOT
#

@marsh pulsar :white_check_mark: Your 3.12 eval job has completed with return code 0.

25.5
sinful haven
#

Turn it into a string, and use insert() at the index 2

marsh pulsar
sinful haven
#

He wants it aftet the second digit?

marsh pulsar
#

also strings don't have insert()

sinful haven
#

Oh does it not? I see

marsh pulsar
unreal mist
#

no that works great i didnt even think of dividing it

sinful haven
#

4555, according to you would be 455.5, ehich is not after the second digit tho

unreal mist
#

that not a problem for me no number will be exceeding 999

#

so yeah thanks!

marsh pulsar
flat nymphBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.