Code: Select all
ext = ('.pdf', '.doc', '.xls')
'test.doc'.endswith(ext)
Code: Select all
True
Code: Select all
TypeError: can't convert 'tuple' object to str implicitly
Code: Select all
ext = ('.pdf', '.doc', '.xls')
'test.doc'.endswith(ext)
Code: Select all
True
Code: Select all
TypeError: can't convert 'tuple' object to str implicitly