So I wanted to create an IP randomizer but cannot find out how to make it so the number comes out as x.x.x.x instead of x . x . x . x
Code:
randomnum = random.randint(1,255)
randomnum2 = random.randint(1,255)
randomnum3 = random.randint(1,255)
randomnum4 = random.randint(1,255)
print('Random IP = "%d"' % randomnum % '. "%d"' % randomnum2 % '. "%d"' % randomnum3 % '. "%d"' % randomnum4 % '. "%d"')
Aucun commentaire:
Enregistrer un commentaire