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