Advertisement
Guest User

Untitled

a guest
Mar 28th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. # myGrades.txt contains the following lines:
  2. # Biology 95
  3. # History 85
  4. # CS 99
  5.  
  6. myFile = open('myGrades.txt', 'r')
  7.  
  8. myGradeLine = myFile.readline()
  9. while myGradeLine != '':
  10.         myData = myGradeLine.split()
  11.         print("My " + myData[0] + " grade is a " + myData[1] + ".")
  12.         myGradeLine = myFile.readline()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement