Issue with int/input/print in homework
<p>This is a three part question that I am having issues with....</p>

<ol>
<li><p>My output is not giving me the option to input my integer, it is printing "none" on the following line and skipping the option</p></li>
<li><p>Ending the file trigger is not working properly</p></li>
<li><p>counting the players that I have recorded data for....I honestly don't know where to start on counting inputs</p></li>
</ol>

<p>--------------------My Output----------------------
You will be asked to enter players names and scores
When you have no more names, enter End</p>

<p>Enter Player's Name or End to exit program: Randy
Enter Randy 's golf score: 
None
------------------My Output END--------------------</p>

<h2>My code;</h2>

<pre><code>def main():
     #introduction to user explaining required information to be entered
     print("You will be asked to enter players names and scores")
     print("When you have no more names, enter End")

     #double blank space
     print("\n")

     #defined y/n
     anotherPlayer = "y"

     #define file path to save user input
     usersFile = open('golf.txt', 'w')

     #
     while anotherPlayer == "y":
         playerName = input("Enter Player's Name or End to exit program: ")
         score = int(input(print("Enter", playerName, "'s golf score: ")))
         usersFile.write(playerName + "," + str(score) + "\n")

         anotherPlayer = input("Is there another player? y / End: ")

     End = usersFile.close()

main()
</code></pre>

<p>-----------------end my code--------------------</p>

<p>I need it to say;</p>

<p>---------Assignment output Needed-----------------</p>

<p>You will be asked to enter players names and scores
When you have no more names, enter End</p>

<p>Enter Player's Name or End to exit program: Randy
Enter Randy 's golf score: 50</p>

<p>Enter Player's Name or End to exit program: End
You have written 1 players records to golf.txt</p>

<p>---------End assignment output----------------</p>

<pre><code>score = int(input(print("Enter", playerName, "'s golf score: ")))
</code></pre>

<p>Should be changed to </p>

<pre><code>score = int(input("Enter {0}'s golf score: ".format(playerName)))
</code></pre>

<p>for opening and closing a file in python the efficient method is as follows:</p>

<pre><code>with open("filename", "w") as userFile:
    userFile.write(data)
</code></pre>

<p>using the with open method will close the file for you when the loop is complete. </p>

python input integer