Regela icon

Lalala

Regela | PRO | 03/02/22 10:13:18 AM UTC | 0 ⭐ | 925 👁️ | Never ⏰ | []
Python |

790 B

|

None

|

0 👍

/

0 👎

r = {
    "robot":True,
    "confirm":False,
}
 
 
if "robot" in r and "confirm" in r and r["confirm"] == False:
    print("do1")
elif "robot" in r and "confirm" in r and r["confirm"] == True:
    print("do2")
elif "robot" in r:
    print("do3")
elif "confirm" in r:
    if not r["confirm"]:
        print("do4")
    else:
        print("do5")
 
any = ()
 
# obj = {
#     ({"robot": any, "confirm": False}): print("dol1"),
#     ({"robot": any, "confirm": True}): print("dol2"),
#     ({"robot": any}): print("dol3"),
#     ({"confirm": any}): print("dol4"),
# }
 
obj2 = {
    (("robot", any), ("confirm", True)): print("dol1"),
    (("robot", any), ("confirm", False)): print("dol2"),
    (("robot", any)): print("dol3"),
    (("confirm", True)): print("dol4"),
}
 
print(obj2[])

Comments