如何编写一个函数render_user,它接受userlist返回的一个元组和一个字符串模板,并返回替换到模板中的数据,例如:
>>> tpl = "<a href='mailto:%s'>%s</a>"
>>> render_user(('matt.rez@where.com', 'matt rez', ), tpl)
"<a href='mailto:matt.rez@where.com>Matt rez</a>"
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激