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