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