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