Level 9 : What will be the output of the following code?


b=30
def fun(a, b=b):
     return a+b
print(fun(1))

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