Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dic = {"Piotr": 2, "Piotr2": -100, "Piotr3": 201, "Piotr4": 30, "Piotr5": 36}
- def func(dic: dict):
- tempDic = {}
- for k, v in dic.items():
- if v > 200:
- tempDic[k] = "sen wieczny"
- continue
- if v < 0:
- continue
- else:
- tempDic[k] = 8 / m.log10(v)
- return tempDic
- #diccomprehansion
- dict1 = {k: "sen wieczny" for (k, v) in dic.items() if v > 200}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement