-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathex23.py
More file actions
37 lines (27 loc) · 794 Bytes
/
ex23.py
File metadata and controls
37 lines (27 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/home/wizard/anaconda3/bin/python
# 1. декларация
def show(title,*args,**kwargs):
print(f'Positional: title={title}')
if args:
print('List of args:')
for v in args:
print(f'arg:{v}')
if kwargs:
print('Keyword params:')
if 'ip' in kwargs:
print(f'gateway:{kwargs["ip"]}')
if 'path' in kwargs:
print(f'path:{kwargs["path"]}')
if __name__ == '__main__':
# 2. извикване
show('Text Editor')
show('Text Editor',11,22,33)
# Ok!
# show('Text Editor',22,44,66,ip='192.168.1.1', path='/usr/local')
# Ok!
# show('Text Editor',ip='192.168.1.1', path='/usr/local')
config = {
'ip':'192.168.1.1'
, 'path':'/usr/local'
}
show('Text Editor', **config)