The error message "TypeError: can only concatenate str (not 'types.GenericAlias') to str" occurs when you try to concatenate a string with a GenericAlias object, rather than another string.

To fix this error, you need to convert the GenericAlias object to a string before concatenating it with the existing string. Here's an example of how you can do that:

kk = kk + str(list[ll.index(jj)])

By using the str() function, you can convert the GenericAlias object to a string and concatenate it with the existing string kk

TypeError can only concatenate str not typesGenericAlias to str kk=kk+listllindexjj

原文地址: https://www.cveoy.top/t/topic/isGV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录