Giter Site home page Giter Site logo

Comments (1)

likejazz avatar likejazz commented on August 31, 2024

안녕하세요.

mutable/immutable 차이에 따른 메소드 작성 가이드가 PEP에 정의되어 있는지는 확인이 필요할 것 같습니다. 다만, 기본적으로는 말씀하신대로 str은 immutable이므로 in-place 수정이 불가능합니다. 값을 return 하는 것 외에는 변경된 값을 전달할 수 있는 방법이 없습니다. 물론 이렇게 되면 추가적인 공간 복잡도가 필요하게 되므로 가능하기만 하다면 리스트 처럼 in-place 수정이 가장 좋겠습니다.

리턴 여부는 함수 작성자가 결정할 문제이므로 이 방식이 PEP에 정의되어 있는 공식 가이드 인지는 확인이 필요할 것 같습니다.

from python-algorithm-interview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.