Skip to content

May be its an issue , as Strings are immutable #129397

@kunalrai1005

Description

@kunalrai1005

Crash report

What happened?

Question1 = first_str="hello"
second_str="hell"
second_str="hell"+'o'

print(first_str is second_str)
Answer 1 = True

**Question2 =**first_str="hello"
second_str="hell"
second_str+='o'

Answer 2 print(first_str is second_str)

If strings are immutable then both results should be false , sinece + also make another string

CPython versions tested on:

3.9

Operating systems tested on:

No response

Output from running 'python -VV' on the command line:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions