Level 10 : Which of the following statements is incorrect about the following code?


class People():

  def __init__(self, name):
    self.name = name

  def namePrint(self):
    print(self.name)

person1 = People("Sally")
person2 = People("Louise")
person1.namePrint()

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