How to represent IP address and port in tuple with Python

1 Answer

0 votes
ip_address = ('127.0.0.1', 8080)

print(ip_address)

print(ip_address[0])
print(ip_address[1])


'''
run:

('127.0.0.1', 8080)
127.0.0.1
8080

'''

 



answered Sep 23, 2017 by avibootz

Related questions

2 answers 198 views
1 answer 158 views
1 answer 117 views
1 answer 246 views
2 answers 215 views
215 views asked Jun 23, 2016 by avibootz
2 answers 276 views
1 answer 114 views
...