micropython: add micropython component
This commit is contained in:
19
components/language/micropython/tests/basics/fun_defargs2.py
Normal file
19
components/language/micropython/tests/basics/fun_defargs2.py
Normal file
@@ -0,0 +1,19 @@
|
||||
# overriding default arguments
|
||||
|
||||
def foo(a, b=3):
|
||||
print(a, b)
|
||||
|
||||
# override with positional
|
||||
foo(1, 333)
|
||||
|
||||
# override with keyword
|
||||
foo(1, b=333)
|
||||
|
||||
# override with keyword
|
||||
foo(a=2, b=333)
|
||||
|
||||
def foo2(a=1, b=2):
|
||||
print(a, b)
|
||||
|
||||
# default and keyword
|
||||
foo2(b='two')
|
Reference in New Issue
Block a user