I am working on a programming assignment, and the directions specify:
"Your program should terminate when it reaches the end of the input file, or the end-of-file on stdin (when control-D is typed from the keyboard under Linux)."
This is what I have so far:
userInput = rawInput()
while userInput != "":
#other stuff the program will do
This is my first time programming in python, and I am using pycharm editor. I am a little confused if this works. Normally in java I would check if userInput is null, but it seems like python doesnt have null objects? Also, does this account for the part in the instructions that says "when control-D is typed from the keyboard under Linux)."?
Since I'm using pyCharm to edit and run my file before turning it in, how do I test to simulate when control-D is typed from the keyboard under Linux" ?