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 12 cs

2. Create a module MassConversion.py that stores function for mass conversion e.g.,

sa 12 cs chapter 4 / PythonCSIP CS IP

help(MassConversion) displays

2. Create a module MassConversion.py that stores function for mass conversion e.g., Read More »

19. Create a dictionary named D with three entries, for keys ‘a’, ‘b’ and V . What happens if you try to index a nonexistent key (D[‘d’]) ? What does Python do if you try to assign to a nonexistent key d (e.g., D[‘d’]=’spam’) ?

sa 12 cs chapter 2 / PythonCSIP CS IP

# Code D = {‘a’:1, ‘b’:2, ‘c’:3} If we try to call with a non-existing key, python will raise an error If we try to assign to a nonexistent key, a new key:value pair will be added to the dictionary e.g. print(D[‘d’]) # raises error D[‘d’] = ‘spam’ print(D) # {‘a’: 1, ‘b’: 2, ‘c’:

19. Create a dictionary named D with three entries, for keys ‘a’, ‘b’ and V . What happens if you try to index a nonexistent key (D[‘d’]) ? What does Python do if you try to assign to a nonexistent key d (e.g., D[‘d’]=’spam’) ? Read More »

Post pagination
← Previous 1 … 198 199
  • 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.