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