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