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 | 1736+ Python FAQs | Share
postfix | keyword | global-variable | operations | turtle | mysql | inheritance | sum() | precedence | update | string-formatting | int | pandas | data-structure | with-statement | asyncio-module | random-function | global | multiprocessing | expand-tab | goto-function | method | call | list-comprehension | pseudocode | pickling-&-unpickling | identity-operator | data_structure | loop-control | while-else-loop | slice | invalid-list | exception | feature | syntax-error | lambdas | objects | function | generators-in-python | file-handling | random | sum-function | namespace | floating-point-precision | collections | exponentiation | syntax-error | async | compute | odd-number | bitwise | __all__-attribute | syntaxerror | logical-operator | round-function | def | assert | counter-function | touples | context-manager | mutable | identifier | integer | logical-operator | statement | python-repl | bitwise-operator | input-function | class-and-inheritance | methods | mapping-function | python | gil | enumerate() | lambda-function | logical-operation | __future__ | asyncio | recurssion | map-function | descriptors | stack | magic-method | tuple | round | class | control-statement | formal-and-actual-parameter | min-function | zfill-function | file-handling | data-type | debugging | built-in-function | generators | input | heap-memory | split | global-keyword | oops | list | sorted | choice | virtual-environment | list-comprehension | escape-operator | arithmetic-expression | immutability | mathematics | input-function | comment | data-structure | comparison | operator-or | lambda | classes | version-check | else-statement | access-modifier | virtual-environment | list-indexing | object-attribute | string-formatting | conditional-statement | encapsulation | swapping | yield | overflow | while-loop | operators | slicing | exception-handling | init | error | recursion | error-handling | string-slicing | control-flow | list-method | boolean | list-slicing | typeerror | threading | string-manipulation | nested-loop | tuple-unpacking | head-and-tail | binary | functions | array | shallow-copy | constructor | operator-overloading | python-history | data-structures | default-mutable-argument | pep | zip-function | class-and-instance-variable | loop | set-operation | inherit | built-in-function | memory-management | oop | center | set | sys | numeric | list-operation | software-design | file | library | dicts | min-max-function | list-join | factorial-function | implementation | deep-copy | datatype | type-conversion | format | scientific-notation | decimal | copy | operand | zip | range | matplotlib | precedence-and-associativity | basic | loops | functional-programming | multithreading | decorator | encoding | staticmethod | dictionary | match | datetime | data-type | identity-operator | complex | __init_subclass__ | math | fabs-function | class-and-object | operator | generator | variable | application | control-flow | filter-function | complex-number | assignment-operator | append | multiple-inheritance | syntax | namedtuple | installation | file_handling | python_version | static-method | comprehension | memory | type-conversion | regular-expression | name-mangling | function-and-scope | condition | command-line-parsing | iterator | string-iteration | indentation | for | numpy | string-method | benefit | dictionaries | destructor | docstring | indexing | version | list-mutation | import-method | python-django | function-argument | iterable | exception-handling | filter | interpreter | module | sorting | parameter | python-module | collection | string | regex | list-vs-tuple | thread | built-in | sys-module | rollback | arithmetic-operation | global-variable | id-function | lists | boolean-and-non-boolean | higher-order-function | polymorphism | print | attribute | string-slicing | bitwise-operator | immutable-data-type | return-statement | string-concatenation | mathematical-function | design-principle | while-and-for-loop | counter | matrix-list-comprehension | print-statement | operator-and | raise | math-copysign | max-min | join | frozenset | matrix | conditional-statement | package-management | type_conversion | string-method | binary-operation | expression | conversion ...