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