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