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