sampleDict = {
  "name": "Kelly",
  "age":25,
  "salary": 8000,
  "city": "New york"
  
}
keys=['name','age']
d={x:sampleDict[x] for x in keys}
print(d)

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: