私は AC コーダーですが、Python は異なります。これに関する問題に遭遇しました
items = [
["/ank/homepage.py","Home"],
["/ank/package.py","Packages"],
["/status.py","Status"],
["/task.py","Task"],
["/report.py","Report"]
]
static_html='<table id="main_nav" align="center"><tr>'
for each_item in items:
if each_item in items:
if isinstance(each_item, list):
static_html= static_html + '<td><a href=" ', each_item[0], ' "> ', each_item[1], ' </a></th> '
static_html+='</tr></table>'
print static_html
次に、IDE からエラー /usr/bin/python2.7 が送信されます
/home/tsuibin/code/aps/dxx/test_tmp.py
Traceback (most recent call last):
File "/home/tsuibin/code/aps/dxx/test_tmp.py", line 39, in <module>
printMainNavigation()
File "/home/tsuibin/code/aps/dxx/test_tmp.py", line 20, in printMainNavigation
static_html= static_html + '<td><a href=" ', each_item[0], ' "> ', each_item[1], ' </a></th> '
TypeError: can only concatenate tuple (not "str") to tuple
Process finished with exit code 1