parametre default

This commit is contained in:
Mert Gör 🇹🇷 2023-05-23 17:35:05 +03:00
parent 88e8f671e7
commit 0e56cb329a
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -0,0 +1,9 @@
def foo(a, b = 100, c = 200):
print('a = ', a, 'b = ', b, 'c = ', c)
foo(1) # foo(1, 100, 200)
foo(1, 2) # foo(1, 2, 200)
foo(1, 2, 3) # foo(1, 2, 3)