Skip to content
← Back to Community
Removing last digit
Profile icon
ashfaqkhan1

Only 4 lines of coding. How to remove last digit and print without last digit

Voters
Profile icon
AngusTownsend
Profile icon
ashfaqkhan1
Comments
hotnewtop
Profile icon
CodeLongAndPros

Try
int(str(number)[0:len(str(number))-1])

Profile icon
Vandesm14

I moved your post to Ask, which is the board for asking questions.

Profile icon
MocaCDeveloper

I will refer you to This Website

Profile icon
ashfaqkhan1

@MocaCDeveloper thank you

Profile icon
MocaCDeveloper

@ashfaqkhan1 Yeah. That one I gave you where I used replace would've worked but would've taken more steps, as I had figured out after I sent the comment!

I hope the link I gave you helps!
If not, let me know!!

Profile icon
ashfaqkhan1

@MocaCDeveloper Thanks again. I will let you know.