-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython_args
35 lines (25 loc) · 919 Bytes
/
python_args
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
def myargs(*argv):
for arg in argv:
print (arg)
def kfun(**kwargs):
for key, value in kwargs.items():
print ("%s : %s" %(key, value))
def kfun(**myargs):
for key, value in myargs.items():
print ("%s : %s \t\t\t\t\t%s" %(key, value, type(value)))
def myargs(firstarg, *argv):
print ("First arg:", firstarg)
for arg in argv:
print("Next args in *argv :", arg)
def test(x):
if isinstance(x, bool) : return "Bool"
if isinstance(x, int) : return "Integer"
if isinstance(x, str) : return "String"
if isinstance(x, float) : return "Float"
if isinstance(x, bytes) : return "Byte"
if isinstance(x, list) : return "List"
if isinstance(x, dict) : return "Dict"
if isinstance(x, set) : return "Set"
if isinstance(x, tuple) : return "Tuple"
if isinstance(x, object) : return "Object"
return "Unknown"