Python 문자열 길이 반환 함수 len()
len()은 문자열 길이를 반환하는 함수이다. length의 약어. 1. 문자열 (공백도 count) len("내 아이디는 ddah0329이다.") >>> 18 2. 숫자 -> 문자열로 바꿔서 len(0329) >>> 오류 발생 (숫자라서) len(str(0329)) >>> 4 3. 자료형 (리스트, 튜플, 딕셔너리, 세트 등) - 총 갯수 len([10, 20, 30, 40, 50]) >>> 5 myList = [10, 20, 30, 40, 50] len(myList) >>> 5
- Programming/Python
- · 2024. 1. 15.
터틀 input 입력함수, write 사용
- Programming/Python
- · 2024. 1. 10.