Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. dic = {"Piotr": 2, "Piotr2": -100, "Piotr3": 201, "Piotr4": 30, "Piotr5": 36}
  2.  
  3.  
  4. def func(dic: dict):
  5.     tempDic = {}
  6.     for k, v in dic.items():
  7.         if v > 200:
  8.             tempDic[k] = "sen wieczny"
  9.             continue
  10.         if v < 0:
  11.             continue
  12.         else:
  13.             tempDic[k] = 8 / m.log10(v)
  14.     return tempDic
  15.  
  16. #diccomprehansion
  17. dict1 = {k: "sen wieczny" for (k, v) in dic.items() if v > 200}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement