Level 10 : What does the following code output?


class People():

    def __init__(self, name):
      self.name = name

    def namePrint(self):
      print(self.name)

  person1 = People("Sally")
  person2 = People("Louise")
  person1.namePrint()

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