Regela

Lalala

Mar 2nd, 2022
893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.79 KB | None | 0 0
  1. r = {
  2.     "robot":True,
  3.     "confirm":False,
  4. }
  5.  
  6.  
  7. if "robot" in r and "confirm" in r and r["confirm"] == False:
  8.     print("do1")
  9. elif "robot" in r and "confirm" in r and r["confirm"] == True:
  10.     print("do2")
  11. elif "robot" in r:
  12.     print("do3")
  13. elif "confirm" in r:
  14.     if not r["confirm"]:
  15.         print("do4")
  16.     else:
  17.         print("do5")
  18.  
  19. any = ()
  20.  
  21. # obj = {
  22. #     ({"robot": any, "confirm": False}): print("dol1"),
  23. #     ({"robot": any, "confirm": True}): print("dol2"),
  24. #     ({"robot": any}): print("dol3"),
  25. #     ({"confirm": any}): print("dol4"),
  26. # }
  27.  
  28. obj2 = {
  29.     (("robot", any), ("confirm", True)): print("dol1"),
  30.     (("robot", any), ("confirm", False)): print("dol2"),
  31.     (("robot", any)): print("dol3"),
  32.     (("confirm", True)): print("dol4"),
  33. }
  34.  
  35. print(obj2[])
Advertisement
Add Comment
Please, Sign In to add comment