Level 10 : 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 | 1736+ Python FAQs | Share
raise | pep | expand-tab | touples | else-statement | immutability | loop | version | nested-loop | destructor | namedtuple | map-function | string-method | goto-function | string-formatting | precedence-and-associativity | sys | class-and-inheritance | encoding | data-structure | virtual-environment | python-history | global-keyword | numeric | default-mutable-argument | built-in | logical-operator | context-manager | fabs-function | random | split | exponentiation | file | multithreading | matplotlib | expression | __init_subclass__ | command-line-parsing | encapsulation | generators-in-python | objects | async | data-type | design-principle | mathematical-function | string-iteration | round-function | asyncio-module | threading | module | loops | file_handling | virtual-environment | list | collection | magic-method | binary-operation | exception | attribute | variable | generator | postfix | complex-number | random-function | input-function | class-and-object | slice | bitwise | sum() | parameter | list-vs-tuple | class | data_structure | identifier | numpy | function | class-and-instance-variable | for | formal-and-actual-parameter | frozenset | control-flow | list-indexing | enumerate() | data-type | string-manipulation | bitwise-operator | operator-overloading | python | scientific-notation | higher-order-function | filter | set-operation | data-structure | file-handling | statement | call | type_conversion | round | boolean-and-non-boolean | operator-and | operators | factorial-function | functions | control-flow | head-and-tail | slicing | logical-operation | namespace | precedence | sorting | max-min | binary | assignment-operator | copy | lists | error-handling | counter-function | list-operation | keyword | gil | int | name-mangling | type-conversion | with-statement | complex | __future__ | exception-handling | dictionaries | interpreter | lambda | method | error | escape-operator | benefit | list-comprehension | debugging | decimal | while-else-loop | polymorphism | floating-point-precision | init | operand | lambdas | input | format | indexing | static-method | descriptors | decorator | integer | docstring | mutable | constructor | operator | print | logical-operator | regex | string-method | filter-function | min-max-function | conditional-statement | range | matrix-list-comprehension | object-attribute | condition | return-statement | sorted | tuple-unpacking | center | id-function | list-slicing | tuple | global-variable | memory | list-mutation | generators | yield | while-and-for-loop | operations | join | methods | sys-module | heap-memory | shallow-copy | zip | rollback | comprehension | lambda-function | function-argument | comment | math-copysign | library | bitwise-operator | thread | version-check | data-structures | zip-function | mapping-function | set | print-statement | functional-programming | sum-function | python-django | syntaxerror | global | min-function | indentation | classes | string-slicing | input-function | pandas | feature | string-formatting | type-conversion | syntax-error | stack | swapping | operator-or | list-method | deep-copy | invalid-list | odd-number | built-in-function | immutable-data-type | matrix | staticmethod | built-in-function | control-statement | multiple-inheritance | mathematics | python-repl | python_version | syntax | file-handling | turtle | software-design | zfill-function | update | recurssion | pickling-&-unpickling | pseudocode | implementation | package-management | python-module | regular-expression | exception-handling | syntax-error | math | conditional-statement | choice | global-variable | typeerror | datatype | overflow | multiprocessing | iterable | inherit | list-join | assert | access-modifier | compute | asyncio | boolean | import-method | application | dicts | iterator | __all__-attribute | loop-control | mysql | match | conversion | memory-management | dictionary | oops | function-and-scope | inheritance | arithmetic-expression | arithmetic-operation | oop | identity-operator | while-loop | comparison | string-concatenation | counter | datetime | installation | array | recursion | def | string-slicing | basic | string | identity-operator | collections | append | list-comprehension ...