Skip to content

(김*혁 강의노트 14장 is 연산자) #148

@kc937

Description

@kc937
a = "hello"
b = "hello"

print(id(a))
print(id(b))

print(a is b)

is 연산자는 값의 동일성이 아닌 같은 메모리의 주소가 같은지 확인한다고 하셨습니다. 하지만 다음의 경우 값을 각각 할당해주었는데 메모리의 주소가 동일하고 결과적으로 True가 반환되나요?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions