YUNOVA · Python programming

Module 7: Dictionaries & Sets

Notes for offline study · 30 November 2026

Python me dictionary kaise banate hain

Key points

  • Dictionary में हर value का एक नाम होता है, जिसे key कहते हैं।
  • यह curly bracket में लिखी जाती है और हर जोड़ी में colon लगता है।
  • Value निकालने के लिए index नहीं, key लिखते हैं।

Python dictionary methods - get, keys, values, items

Key points

  • get() से value मिलती है और key न हो तो error की जगह None आता है।
  • keys() सारे नाम देता है और values() सारी values।
  • items() दोनों एक साथ देता है, जो for loop में काम आता है।

Python me set aur duplicate hatana

Key points

  • Set में हर चीज़ सिर्फ़ एक बार रहती है; दोहराव अपने आप हट जाता है।
  • List को set() में डालकर duplicate हटाना सबसे आसान तरीक़ा है।
  • Set में क्रम तय नहीं होता, इसलिए index से चीज़ें नहीं निकलतीं।

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.