Page 98 - Modular v1.1 Pyhton
P. 98

2.   Write any one difference between pop( ) and clear( ) method.
                                                                                              Computational Thinking
                      3.   What is the use of get(key) method?
                  F.  What will be the output of the following codes?

                      1.   mydict={"name": "A", "class":"XII", "year":2022}
                           print(mydict)

                           mydict["stream"] = "Science"

                           print(mydict)
                      2.   dict1={'Name': 'A', 'Rollno': 1}

                           print(dict1)
                           dict1['Rollno']=2
                           dict1['Marks']=[15, 47, 54]

                           print(dict1)



                                                    In the lab                                   Subject Enrichment



                    Write a program in Python to:
                    1.  create a dictionary with 15 keys 0...14.
                    2.  traverse a dictionary (dict = {1:'one', 2:'two', 3:'three', 4:'four'}) using a for loop.







                   Teacher's Corner

                  1.   Discuss the concept of key-value pair with the help of examples with the students.
                  2.   Do a walk-through of all the topics covered in this chapter.






























                   96     Touchpad MODULAR (Version 1.0)
   93   94   95   96   97   98   99   100   101   102   103