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