파이썬 내장 함수 (enumerate, map, filter, all, any, isinstance)
파이썬은 기본적으로 많은 내장 함수들을 제공하여 간편하고 효율적인 프로그래밍을 할 수 있도록 도와줍니다. 이 내장 함수들은 별도의 import가 필요하지 않고 언제든지 사용할 수 있습니다. 대표적인 내장 함수들에 대해 자세한 설명과 예시 코드를 제공하겠습니다.1. enumerate() 함수enumerate() 함수는 리스트의 요소와 인덱스를 함께 반환하는 함수입니다.fruits = ['apple', 'banana', 'orange'] for index, fruit in enumerate(fruits): print(f"Index: {index}, Fruit: {fruit}") """ 출력 결과 Index: 0, Fruit: apple Index: 1, Fruit: banana Index: 2, Fruit:..
2023. 7. 28.