Validate IP Address | Python Interview Question | Leetcode
In this video we need to write a function to validate if a string is a valid ip address or not. A valid ip address should be in form of x1.x2.x3.x4 where x1,x2,x3,x4 should be numbers between 0 and 255
Most Asked Join Based Interview Question:
Data Analyst Spotify Case Study:
Top 10 SQL interview Questions:
Interview Question based on FULL OUTER JOIN:
Playlist to master SQL :
Rank, Dense_Rank and Row_Number:
Spyder IDE link : https://www.spyder-ide.org/
#dataengineer #python
ipv4
Not Working
you haven't consider the case of (0.0000,0.0000,0.0000,0.0000) this ip address is invalid while using the approach you told it is not handling the case well
0000.0000.0000.0000 will fail, trailing zeroes are not allowed
please make more videos on python.Thanks
awesome
very good explanation bro, please make more videos on python using same IDE
My implementation:-
def isvalid(ip):
x=ip.split('.')
c=0
for i in x:
if int(i) in range(0,255):
c+=1
else:
c+=0
if c==4:
print('It is an ip')
else:
print('It is not an ip')
Please post more interview questions on python😊.
wow man, I am actually studying in Canada and even my professors can't explain this well, amazing job sir.
simple and easy explanation. Thank you Ankit, waiting for more such videos 🙂
Wow amazing. Can you please start the python series like your SQL
Please add more of such Python interview questions. Really good explanation.
simple and easy explanation. Thank you
Looking forward for more such videos on Python
Completed your both playlist basics one 4 times and complex one 2 times. Now playing randomly and solving by myself to gain confidence.
Thanks Big Brother !!
Awesome ! Thanks for the video. @Ankit, Now time to create more playlist for python.
Doing great job bro. Keep it up
Thanks Ankit. Hope the python playlist will also have interview q/realtime scenarios like your sql playlist
Thank you Ankit
Looking forward for more tutorial..
Thanks Ankit for your python video ..your explanation is good like SQL . Expecting more python videos from you ..
My Implementation
def isvalid_ip(ip):
values=ip.split('.')
if len(values)==4:
for i in values:
if not i.isdigit() or int(i)>255 or int(i)<0:
return False
return True