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