Level 9 : What will be the output of the following code snippet?


numbers = (4, 7, 19, 2, 89, 45, 72, 22)
sorted_numbers = sorted(numbers)
odd_numbers = [x for x in sorted_numbers if x % 2 != 0]
print(odd_numbers)

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