You accept variable number of arguments. So, you need to unpack the list while calling, like this
writeRssFile(*newslist)
Also, you need to import datetime
module.
Apart from that, when the range
actually starts from 0
, you can omit that. So,
range(0, len(newslist))
is the same as
range(len(newslist))