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