Level 10 : What will be printed?


class Counter:
    def __init__(self):
        self.value = 0
    def __call__(self):
        self.value += 1
        return self.value

c = Counter()
print(c(), c(), c())

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