parametre default 3 ve disp_range

This commit is contained in:
Mert Gör 🇹🇷 2023-05-23 18:46:41 +03:00
parent 87411e7eaf
commit d7c17885bc
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,11 @@
def disp_range(start, stop=None, step=1):
if stop == None:
stop = start
start = 0
for i in range(start, stop, step):
print(i, end=' ')
disp_range(10)
disp_range(2, 8)
disp_range(2, 8, 3)

View File

@ -0,0 +1,2 @@
def add(a = 10, b = 20):
return a + b