I am trying to create a random real, integers, alphanumeric, alpha strings and then writing to a file till the file size reaches 10MB.
The code is a
You literally create billions of objects which you then quickly throw away. In this case, it's probably better to write the strings directly into the file instead of concatenating them with ''.join().
''.join()