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