Skip to content

Comparing 2 randomly generated lists in python

I am trying to make a program that will generate a list filled with randomly generated characters, then repeatedly randomizing another until both of them match up. However, when I run the following program, even at the lowest value, it will continuously run, forever. Answer You keep on appending to your secon…

Issue with conversion of text data into a dataframe

I have a text file where I have several lines and between them, some data which I need to convert to the dataframe(useful data). I iterated the text file line by line and captured the useful data with the help of a regex. Something like this, The data captured look like this I thought to iterate each captured…

How to format json so I can parse floats and strings

I am getting the error when I try to run the following code. I know it has something to do with the formating of the json file but I am not sure how to proceed/change in order to be able to get floats from the json file my code Answer data[‘listingReducer’][‘geoCode’] is a dict so doin…

Pygame window isn’t updating

I’m writing a small python game just to learn how to use python better. I wanted to try to start using multiple scripts, as keeping all of the code in one script can get a little crowded. I made a second script, created a function main(scrn) and everything seems to be working fine. Calling that function…