String Processing in Python: String to Integer

In this video, we will be solving the following problem:

You are given some numeric string as input. Convert the string you are
given to an integer. Do not make use of the built-in “int” function.
“123” : 123
“-12332” : -12332
“554” : 554

This video is part of a series on string processing and, specifically, on how these problems tend to show up in the context of a technical interview:

This video is also part of an “Algorithm” series. For more algorithm tutorials:

The software written in this video is available at:

Do you like the development environment I’m using in this video? It’s a customized version of vim that’s enhanced for Python development. If you want to see how I set up my vim, I have a series on this here:

If you’ve found this video helpful and want to stay up-to-date with the latest videos posted on this channel, please subscribe:


Xem thêm bài viết khác:


  1. Finished all your algorithms and data structure videos, just wanna thank you for all the hard work you paid in! These are totally amazing!!!

  2. Another awsome series have been done ^-^ thanx
    for your efforts

  3. Hi, first of all great content. Also, are you planning to expand algorithm topic going foward?

  4. Its unfair: we are still cheating .we do not use int built in function but so easily use 2 built in functions instead:ord and char!
    What do i offer? Break it down to the molecular level and create a dictionary of 10 first digits with corresponding number keys .thus you really break it d down.

  5. crystal clear explanation ,thank you so much

  6. num="123"
    def strtoint(num,s):
    if s==len(num):
    return int(num[s-1])
    for m in range(len(num)):
    return int("".join(num))
    Can i solve it using recursion(i made use of built-in functions in this code, sr about that)

  7. Thanks for the clear explanation

  8. how to convert 'W1234' into int. number should be extracted.

  9. Sir we want more data structure videos… which are useful in programming interview….
    Thanks your videos are amazing….

  10. This process is too complicated. Please input the correct display type.

  11. this work in python 2.7?

  12. I saved it offline to do it practically …
    Explained very nicely

  13. Hi "Lucid Programming " what is your email.? Our is

  14. Please keep up the content, I am learning so much from these videos!

Leave a Reply

Your email address will not be published. Required fields are marked *