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