Answer:
See explaination
Step-by-step explanation:
Please check below for the code for first_word.py file which will print first word of an input file stuff.txt. So the open function will open file in read mode. We had maintained a count variable so that we can skip printing first word of first line. Also the command line.strip() checks whether string is empty or not so that we will not get index error while calling split function over line to get first word.
#!/usr/local/bin/python
stuff = open("stuff.txt", "r");
count = 0;
for line in stuff:
count+=1;
if (count>1 and line.strip()):
print(line.split(maxsplit=1)[0])