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