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