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