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