Small Asteroid Blog

[python] 'in <string>' requires string as left operand, not float 본문

백엔드/Python

[python] 'in <string>' requires string as left operand, not float

작은소행성☄️ 2022. 1. 26. 09:58
728x90

 

int 는 len 을 알 수 없는데 길이 구하는 함수 len 을 사용해서 생기는 문제이다.

사용하고자 하는 데이터를 str로 변경해 문자열로 타입을 변경해서 사용한다. 

 

len(str(data))

 

 

728x90
반응형