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