I Am unable to get IP Address in Ubuntu plz help me

You have to type this in terminal to get the ip address:

ip addr show

i m not getting it

with that comment

If you want to create and run a python code, no need of ip address…directly type =>“sudo nano file_name.py” to create one…and then save and =>“sudo python3 filename” to run it…

If you want to get the IP address of whichever interface is used to connect to the network without having to know its name, you can use this:

import socket
def get_ip_address():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect(("8.8.8.8", 80))
    return s.getsockname()[0]

You do not have to have a route to 8.8.8.8 to use this. All it is doing is opening a socket, but not sending any data.