more function examples

This commit is contained in:
Mert Gör 🇹🇷 2023-05-21 20:23:18 +03:00
parent f9bcfbe07a
commit 5731c0e015
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9
2 changed files with 28 additions and 0 deletions

14
function.10.py Normal file
View File

@ -0,0 +1,14 @@
def foo():
print('foo')
def bar():
print('bar')
def tar():
print('tar')
d = {1: foo, 2: bar, 3: tar}
d[1]()
d[2]()
d[3]()

14
function.9.py Normal file
View File

@ -0,0 +1,14 @@
def foo():
print('foo')
def bar():
print('bar')
def tar():
print('tar')
a = [foo, bar, tar]
for f in a:
f()