DEVNET.

Splitting IP Address string variable in Python

Python variable types post defines the different type’s variable in python. In this post, I will be covering the basis stuff which is used to convert a string into an integer and use it for further validation. The main intent of this article is to write few lines of code which can ask user to input the “IP Address Field” and split the string into different octets by using split function. Once this is done, after that convert the string to integer type so that we can check whether the given input has length of 4 or not (In case of IP Address we have a.b.c.d).

The same lines of codes can become more meaningful and useful when it is applied with if-else or with any kind of loop statements.
The given code is plain code which is used for basic understanding.

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Leave a Reply

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

Become a member

Full Access to 739 Lessons. New Lessons Added Every Week!

Awesome Deal! Get 2 Months for FREE!

No Obligations. Cancel At Any Time!