Page 142 - PYTHON-12
P. 142

Practical Implementation–6


              Write a program to read the contents of “student.csv” file using with open().

































              The above modified code uses “with open()” function, the only difference being that the file being
              opened using with open() gets automatically closed after the program execution gets over, unlike
              open() where we need to give close() statement explicitly.
              Practical Implementation–7

              Write a program to count the number of records present in “student.csv” file.































                                                                                                                  Python Libraries







                                                                                                            4.13
   137   138   139   140   141   142   143   144   145   146   147