help4code-logo
  • eLearning
    • Tutorials
    • Programs
    • Interview Questions
    • Technical Questions
    • C Language
    • C++
    • JAVA
    • HTML & CSS
    • PHP
    • AJAX
    • J2EE
    • SQL
    • jQuery
  • Go back to Home
  • Our Placements
  • Tutorials
  • Programs
  • Interview Questions
  • Technical Questions
  • Live Training
  • Our Placements
  • Associated Colleges
  • Our Recruiters
  • Back
  • C Language
  • C++
  • JAVA
  • HTML & CSS
  • PHP
  • AJAX
  • J2EE
  • SQL
  • jQuery

Programs

  1. Home
  2. Programs
  3. Python
  4. Dictionary
Image

Programs - Python - Dictionary

  • Programs
    • WAP to access value from dictionary
    • WAP for update and delete from dictionary
    • WAP to show use of items() method
    • WAP to check if a given key already exists in a dictionary
    • WAP for different operations on dictionary
    • WAP to show use of pop() and clear() in dictionary
    • WAP to show use of formkeys() and keys() in dictionary
    • WAP for dictionary comprehension
    • WAP for dictionary membership test
    • WAP to iterate dictionary
    • WAP for dictionary built-in function

Program:

# Membership Test for Dictionary Keys
squares = {1: 1, 3: 9, 5: 25, 7: 49, 9: 81}

print(1 in squares)

print(2 not in squares)

# membership tests for key only not value
print(49 in squares)

Output:

True
True
False
Help4Code

The help4code.com - An e-learning educational website where all computer science students can find rich collection of computer language programs which will help in exploring computer programming.

  • About
  • Associated Colleges
  • Leadership
  • Careers
  • Our Recruiters
  • Community
  • Terms
  • Privacy
  • Help
  • Press
  • Contact
  • Directory

First Floor, Plot No. 4, Near Shat Ayu College, Ring Road Nagpur, Maharashtra, India - 440022
+91 9175287066[email protected]

© Copyright 2022 help4code.com.

  • My Account
  • Sign-in
  • Sign-up