Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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[])
Advertisement
Add Comment
Please, Sign In to add comment