Skip to content

Tag: python

Edit/add a line in a python file using another python file

I have got a python file with lines in specific order and I’m trying to add/remove lines in specific place in the file and then save it as a new one. For example: I would like to add an additional line(e.g. parameter3) between these lines and/or remove one of them. Answer Read the lines from file into a…

How to remove a specific element from a 2d array in Python?

I am new to Python and now I’m trying to create a game called Pong Everything looks to work fine but unfortunately, I can’t remove a specific element from 2D-Array /List once the ball touches a brick. Here is my code: In the following method, I want to remove the specific element: I have tried man…