2023-02-25 01:48

This commit is contained in:
2023-02-25 01:48:44 +09:00
commit 90d9816ea2
9 changed files with 151 additions and 0 deletions

17
switch.py Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/python
def function_1():
return 1
def function_2():
return 2
def function_3():
return 3
switch = {1:function_1, 2:function_2, 3:function_3}
val = 2
function = switch[val]
result = function()
print(result)