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