User Profile
Collapse
-
Battleship
I'm trying to write the code for the game Battleship, in order to count how many turns it will take to sink all 5 ships. I've written it without strategy (it just generates random numbers until 17 hits have occurred. However, I can't figure out how to add strategy, so when a hit is scored, the program will adjust to try and specify the spots around the hit and when it finds which direction the rest of the ship lies, it finishes off the ship. Any... -
Adding keys to a dictionary
I have a string stored in a text file. I need to read the string into python as a list of dictionaries. The format of data in the text file (called "input.txt" ) is as follows:
<first name>,<last name>,<box number>,<house number>,<street >,<city>,<state >,<zipCode>,<GP A>
Then there are multiple students, which are just added as one long line.
The format that... -
Need help writing to a text file in Python
I need to use a pre-existing list of strings in the format stated below. these strings need to be written to a text file called "input.txt"
(so basically, there are 3 lines of data for each student and each of the fields is separated by a comma)
<first name>,<middle name>,<last name>,<box number>
<number>,<stree t>,<city>,<stat e>,<zip code>
<gpa>...
No activity results to display
Show More