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