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