Level 9 : What will be the output of the following Python function (random module has already been imported)?


random.choice('sun')

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