Level 10 : What will be the output of the following code?


myArray = array.array('i', [1, 2, 3])
   myArray.append(4)
   print(myArray)

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