Level 1 : What will the following code output?


t = (1, 2, 3)
print(id(t))
t += (4,)
print(id(t))

Author: SandhyaR | Tags: tuple | 1736+ Python FAQs | Share
string-slicing | sys | frozenset | format | asyncio-module | string-iteration | iterable | split | higher-order-function | virtual-environment | data-structure | with-statement | file_handling | installation | multithreading | turtle | while-and-for-loop | bitwise-operator | name-mangling | command-line-parsing | sorted | function | operator-and | return-statement | max-min | bitwise-operator | collection | __init_subclass__ | datetime | pseudocode | binary-operation | expression | matrix | loop-control | filter | functional-programming | update | expand-tab | class | library | round | postfix | exception | fabs-function | loop | conditional-statement | comment | random-function | conversion | statement | debugging | formal-and-actual-parameter | sorting | identifier | goto-function | deep-copy | precedence-and-associativity | polymorphism | zfill-function | control-flow | string-method | scientific-notation | python-history | default-mutable-argument | multiple-inheritance | min-function | immutability | choice | boolean-and-non-boolean | integer | input-function | list-method | oop | data_structure | lambda-function | memory | gil | data-structures | lambda | while-loop | binary | global-variable | syntax-error | asyncio | staticmethod | overflow | slice | mathematics | objects | docstring | error | comparison | list-comprehension | functions | raise | data-type | id-function | application | counter-function | built-in-function | numeric | matrix-list-comprehension | mathematical-function | numpy | list-vs-tuple | def | min-max-function | head-and-tail | swapping | complex | mysql | operators | else-statement | type_conversion | identity-operator | floating-point-precision | heap-memory | sum() | magic-method | immutable-data-type | map-function | inherit | sum-function | string-method | arithmetic-operation | version | conditional-statement | python_version | operator-overloading | global-keyword | math-copysign | operations | inheritance | assert | python | dictionaries | input | logical-operator | match | string-manipulation | datatype | iterator | rollback | error-handling | classes | python-django | generator | factorial-function | list-comprehension | filter-function | memory-management | list-operation | mapping-function | lists | escape-operator | mutable | virtual-environment | operand | methods | module | assignment-operator | global-variable | set-operation | variable | dictionary | encoding | invalid-list | attribute | list-join | sys-module | center | thread | object-attribute | print | boolean | implementation | built-in | nested-loop | function-argument | feature | odd-number | encapsulation | async | data-structure | matplotlib | function-and-scope | precedence | tuple-unpacking | call | destructor | class-and-inheritance | __all__-attribute | bitwise | tuple | operator-or | syntax-error | descriptors | range | namedtuple | interpreter | oops | loops | random | math | threading | static-method | touples | keyword | design-principle | built-in-function | parameter | regular-expression | python-repl | type-conversion | multiprocessing | indentation | file-handling | slicing | syntax | indexing | pickling-&-unpickling | method | dicts | condition | list-mutation | logical-operator | decorator | context-manager | pandas | zip | stack | complex-number | int | namespace | software-design | counter | type-conversion | set | copy | exception-handling | version-check | string-concatenation | generators | join | round-function | data-type | typeerror | import-method | python-module | init | class-and-instance-variable | yield | collections | access-modifier | recurssion | benefit | list-indexing | lambdas | syntaxerror | identity-operator | global | class-and-object | while-else-loop | constructor | file | arithmetic-expression | input-function | control-flow | shallow-copy | array | pep | string | string-formatting | exception-handling | string-formatting | compute | basic | string-slicing | package-management | comprehension | operator | __future__ | regex | logical-operation | exponentiation | print-statement | recursion | list-slicing | enumerate() | list | decimal | file-handling | zip-function | generators-in-python | append | control-statement | for ...