Level 1 : What will the following code output?


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

Author: SandhyaR | Tags: tuple | 1859+ Python FAQs | Share
thread | with-statement | zip-function | regular-expression | single-inheritance | staticmethod | regex | logical-operator | sum-function | implementation | built-in | boolean | static-method | directory-operations | identity-operator | postfix | data-type | dicts | append | data-structures-in-python | conditional-statements | zip | scientific-notation | array | inherit | software-design | formal-and-actual-parameter | round-function | touples | def | using-yield-in-functions | string-iteration | data-type | input-function | sys | class-and-object | dictionary | indexing:-loc-vs-iloc | counter-function | using-os-and-pathlib-modules | int | compute | data-structures | list-mutation | memory-management | integer | class-decorators | stack | parameter | counter | file | file-handling | async | function | logical-operators | syntax | module | managing-directories-with-os-and-shutil | exception-handling | intering | thread-synchronization | random-function | update | feature | constructor | format | datatype | namedtuple | functional-programming | design-principle | gil | syntax-error | oops | __all__-attribute | time-series-with-pandas | python-operators | __future__ | condition | defining-functions | mapping-function | type_conversion | conditional-statement | type-conversion | binary-operation | round | namespace | working-with-file-paths | comment | python | matrix | string-method | comprehension | walking-through-directories-using-os.walk() | numpy | python-repl | nested-loop | list-indexing | writing:-write(),-writelines() | class-and-instance-variable | oop | exponentiation | strings | string-slicing | complex-number | pseudocode | string-method | arithmetic-operation | slicing | complex | string-slicing | installation | creating-and-starting-threads | random | control-flow | tuple | turtle | sorted | global-variable | iterator | global-keyword | debugging | operators | filtering-and-indexing | inheritance | function-and-scope | multiple-inheritance | higher-order-function | dictionary-comprehensions | iterable | range | loops | membership-operators-(in,-not-in) | regular-expressions | string-formatting | mathematics | working-with-temporary-files-using-tempfile | tuples | for | operand | keyword | lambda-function | sorting | input-function | center | while-else-loop | assert | introduction-to-multiprocessing | data-type-conversions | introduction-to-python | lambda | package-management | difference-between-threads-and-processes | generators | using-the-threading-module | expression | using-map()-for-transformations | pep | error-handling | comparison | init | mathematical-function | collections | type-conversion-and-casting | typeerror | asyncio-module | key-value-pairs | datetime.date,-datetime.time,-datetime.datetime | return-statement | list-vs-tuple | using-assertions-(assertequal,-assertraises) | mysql | dictionaries | python-module | variable | aggregating-data-with-functools.reduce() | loop-control-statements | list-join | file_handling | overriding-methods | floating-point-precision | bitwise-operator | yield | __init_subclass__ | goto-function | operations | using-else-and-finally | list-method | class-and-inheritance | string-manipulation | multiple-except-blocks | quantifiers-(*,-+,-?,-{}) | else | list-slicing | recurssion | loop | default-arguments | syntax-error | formatting-with-strftime | version-check | interpreter | recursion | encoding | operator-and | factorial-function | exception | unit-testing | indexing | classes | choice | tuple-unpacking | matrix-list-comprehension | test-discovery | built-in-modules | error-handling | list-comprehension | decimal | object-attribute | docstring | anchors-(^,-$) | dictionary-methods | list-methods-and-slicing | heap-memory | pickling--unpickling | operator-overloading | split | min-max-function | math-copysign | type-conversion | swapping | boolean-masking | match | application | functional-programming | head-and-tail | math | handling-missing-values-(fillna,-dropna) | basic | bitwise-operator | identifier | identity-operators-(is,-is-not) | reading:-read(),-readline(),-readlines() | conversion | thread-safe-data-structures-(queue.queue) | fabs-function | version | using-join()-and-is_alive()-methods | operator-or | library | filter | advanced-file-operations | collection | logical-operator | error | control-statement | threading | polymorphism | creating-custom-modules | precedence-and-associativity | python_version | function-argument | id-function | string-concatenation | python-syntax-and-structure | min-function | datetime | else-statement | set-operation | syntaxerror | list-comprehensions | built-in-function | global-variable | numeric | integers | method | virtual-environment | identity-operator | string-formatting | objects | raise | arithmetic-expression | raise-statement | loop-control | while-and-for-loop | filter-function | control-flow | string | reading-and-writing-files | pass | print | enumerate() | generators-in-python | assignment-operators | string-methods | opening-files-(open()) | data-structure | statement | multiprocessing | overflow | default-mutable-argument | frozenset | copy | join | sum() | booleans | indentation | map-function | expand-tab | magic-method | generator | precedence | while-loops | while-loop | invalid-list | sys-module | list-operation | list-comprehension | boolean-and-non-boolean | print-statement | assignment-operator | asyncio | import-method | immutable-data-type | tuple-methods | binary | dataframe-and-series-objects | max-min | data-types | working-with-binary-files-(rb,-wb) | encapsulation | python-django | data-structure | context-manager | matplotlib | decorator | set | lists | slice | floats | command-line-parsing | arbitrary-arguments-(*args,-**kwargs) | methods | built-in-function | functions | iterators | lambda-functions | logical-operation | shallow-copy | odd-number | file-handling | immutability | bitwise | escape-operator | sorting-and-ranking | method-overloading | introduction-to-threads | parsing-with-strptime | working-with-dates-and-times | global | using-lists-as-stacks | virtual-environment | attribute | rollback | name-mangling | input | reading-and-writing-large-files-efficiently | sets | list | mutable | call | list,-set,-and-dictionary-comprehensions | deep-copy | python-history | access-modifier | pandas | zfill-function | benefit | operator | conditional-statement | lambdas | data_structure | descriptors | literal-characters-and-special-characters | destructor | multithreading | multiple-inheritance | exception-handling | class | why-use-multiprocessing-over-threading?-(gil) | memory | joining-and-merging-dataframes ...