CHECK IP ADDRESS OF A COMPUTER

 CHECK IP ADDRESS OF A COMPUTER



SOURCE CODE:-

 
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
# Python Program to Get IP Address
  
import socket
 
Hostname = socket.gethostname()
     
IP_Address = socket.gethostbyname(Hostname)
     
print("Your Computer Name is: ", Hostname)
     
print("Your Computer IP Address is: ", IP_Address)
       
# Output:-
# Hostname: DESKTOP-A0PM5GD
# IP Address: 192.168.43.15
 
 
# Python Program to Get IP Address
 
import socket

Hostname = socket.gethostname()
    
IP_Address = socket.gethostbyname(Hostname)
    
print("Your Computer Name is: ", Hostname)
    
print("Your Computer IP Address is: ", IP_Address)
      
# Output:-
# Hostname: DESKTOP-A0PM5GD
# IP Address: 192.168.43.15

Follow me on Instagram:- Python_with_Shubham



0 Comments