Level 5 : What will be the result of len(s) after execution?


s = {1, 2, 3}
s.add(4)
s.remove(2)

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