Ministério da Educação
Brasil um país de todos
Personal tools
Navigation
Log in


Forgot your password?
 
Document Actions

slides10-ex3.py

by Cicero Garrozi last modified 2014-05-29 07:10

Click here to get the file

Size 1 kB - File type text/python-source

File contents

f = open("ips.txt", "r")

for linha in f:
    valido = True
    lista = linha[:-1].split(".")
    for elem in lista:
        if int(elem) > 255:
            valido = False
            break
    if valido == False:
        print "IP invalido: "+linha[:-1]
    else:
        print "IP valido: "+linha[:-1]

Powered by Plone CMS, the Open Source Content Management System

This site conforms to the following standards: