IP Address
An Internet Protocol(IP) is a numeric label which is assigned to each device. This is the method or protocol by which message can be sent over the internet. IP Address is an unique Identity of an device by which it can be uniquely identify.
Code:
- import socket
- hostname=socket.gethostname()
- IPAddr=socket.gethostbyname(hostname)
- print("Your Computer Name is:"+hostname)
- print("Your Computer IP Address is:"+IPAddr)
Output: