- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 3
- Posts with Downvotes
- 2
- Downvoting Members
- 3
8 Posted Topics
hey folks, i'm trying myself on a csv based adressbook but I get the following error: [CODE] Traceback (most recent call last): File "C:\Dokumente und Einstellungen\Mo\Desktop\adressbook.py", line 11, in <module> writer.writerows(data) File "C:\Python26\lib\csv.py", line 149, in writerows rows.append(self._dict_to_list(rowdict)) File "C:\Python26\lib\csv.py", line 140, in _dict_to_list ", ".join(wrong_fields)) ValueError: dict contains fields … | |
hi guys is there a way to refer to every 2nd symbol of a string? example: [CODE] mystring = 'bananasplit' [/CODE] i want to refer to every 2nd and every 3rd symbol of any string the user types in. in this case the 1st symbol is 'b', the 2nd is … | |
Hi Peepz, My Connect 4 board is made up of different lists. My task is to write a function that checks whether the game ends in a draw (that means when every spot is taken by a 'X' or an 'O' without fulfilling the winning requirements If everyspot is filled … ![]() | |
Re: This must do the trick with the win, lose & draw. I gave it a play again option. Unfortunately I don't know how to solve the 'invalid choice' thing if the user enters a String. I'd like to know that too. [CODE] def rockPaperScissors(): import random choice=int(raw_input("please enter your choice(1 … | |
Hello. This time it might be a bit more complicated. [CODE] def start_game(): global no_winner no_winner = True rows_cols() global board board = make_board() print_board() player_select() def rows_cols(): global rows global columns rows = int(raw_input('Height: ')) columns = int(raw_input('Width: ')) if rows < 4: rows = 4 if columns < … | |
Hello. Here I go again. I tried to create a computer enemy for my connect 4 game: [CODE] def turn_comp(): import random print 'Computer ist am Zug!' playchip = random.randint(0, columns) board[0][playchip] = 'O' print_board() [/CODE] Even though I limited the range of randint with 0 and columns (in a … | |
Hello. Here I am again with my Connect 4 project and another board problem. This is my code: [CODE] fielda = [] fieldb = [] rows = int(raw_input('Height: ')) columns = int(raw_input('Width: ')) if rows < 4: rows = 4 if columns < 4: columns = 4 def print_board(): for … | |
Hello This is like my 4th week using Python and I'm still not familiar with it so I might need some help from you guys. I gotta write a little Connect 4 game in Python, I just got started and boom - I'm stuck! I tried to create a board … |
The End.