Skip to content

Instantly share code, notes, and snippets.

@pycoders0000
Created December 16, 2022 04:32
Show Gist options
  • Save pycoders0000/ce7207a546bc28dcb0113f8f3732ab70 to your computer and use it in GitHub Desktop.
Save pycoders0000/ce7207a546bc28dcb0113f8f3732ab70 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
# @Date : 2022-07-25 09:10:55
# @Author : pycoder.py
# @GitHub : (https://github.com/pycoders0000)
# @Twitter : (https://twitter.com/pycoder0000)
# @Instagram : (https://www.instagram.com/pycoder.py/)
# @Version : 1.0.0
def defangaddress(address: str):
return address.replace(".", "[.]")
print(defangaddress("1.1.1.1.1"))
# Defanging an IP address simply means to replace the "." with "[.]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment