Level 9 : What is the output of the following code?


listNumbers = [20, 22, 24, 26, 28, 28, 20, 30, 24]
print(list(set(listNumbers)))

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