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