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