> I am wondering how I would go about making a list of
> IPs between two set
> IPs.
> This is my initial code:
>
>
>
> def list2str(list):
> ip=''
> for part in list:
> if len(ip)!=0:
> ip=ip+'.'+part
> else:
> ip=ip+part
> return ip
>
> ip
Thanks alot to everyone for your help!
I'm not completely sure I understand how Roel's code works so I'll be doing
a bit of research :-) (but it works :-D). Thanks again.
All the best,
Ralf
___
Tutor maillist - Tutor@python.org
http://mail.python.org/
Ralfas Jegorovas wrote:
> I am wondering how I would go about making a list of IPs between two set
> IPs.
# First, list2str can be written shorter
.def list2str(lst):
.return '.'.join(map(str, lst))
# The inverse of that is also needed
.def str2list(s):
.return map(int, s.split('.'))
# N