Skip to content
Pooja Bhatia Classes Hari Nagar
  • We teach following classes
    • Class 12
    • Class 11
    • Class 10
    • Class 9
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship
Pooja Bhatia Classes Hari Nagar

sa 11 ip chapter 8

6. Given two dictionaries say D1 and D2. Write a program that lists the overlapping keys of the two dictionaries, i.e., if a key of D1 is also a key of D2, the list it.

sa 11 cs chapter 13, sa 11 ip chapter 8 / PythonCSIP CS IP

6. Given two dictionaries say D1 and D2. Write a program that lists the overlapping keys of the two dictionaries, i.e., if a key of D1 is also a key of D2, the list it. Read More »

7. Write a program that checks if two same values in a dictionary have different keys. That is, for dictionary D1 = { ‘a’ : 10, ‘b 20, ‘c’ : 10], the program should print “2 keys have same values” and for dictionary D2 = { ‘a’ : 10, ‘b’ : 20, ‘c’ : 30) , the program should print “No keys have same values”.

sa 11 cs chapter 13, sa 11 ip chapter 8 / PythonCSIP CS IP

# Code D1 = {‘a’: 10, ‘b’: 20, ‘c’: 10} count = {} val = D1.values() for i in val: if i not in count: count[i] = 0 count[i] += 1 a = False # This is used to check if there is atleast one value which occurs more than once for i in count.values():

7. Write a program that checks if two same values in a dictionary have different keys. That is, for dictionary D1 = { ‘a’ : 10, ‘b 20, ‘c’ : 10], the program should print “2 keys have same values” and for dictionary D2 = { ‘a’ : 10, ‘b’ : 20, ‘c’ : 30) , the program should print “No keys have same values”. Read More »

Post pagination
← Previous 1 … 3 4 5 … 20 Next →
  • We teach following classes
    • Class 12
    • Class 11
    • Class 10
    • Class 9
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship
  • We teach following classes
  • Sumita Arora IP/CS Solutions
  • Jobs/Internship

Copyright © 2025 Pooja Bhatia Classes Hari Nagar | Powered by Pooja Bhatia Classes Hari Nagar.