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