Level 1 : What will be printed?


class A:
    x = 10

a1 = A()
a2 = A()
A.x = 20
a1.x = 30
print(A.x, a1.x, a2.x)

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