Level 1 : What will be the output of the following Python code?


def func(a, b=5, c=10):
    print('a is', a, 'and b is', b, 'and c is', c)
 
func(3, 7)
func(25, c = 24)
func(c = 50, a = 100

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