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