Level 1 : What does this print?


items = {"a":1, "b":2, "c":3}
for k,v in items.items():
    items["d"] = 4
print(len(items))

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