We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ab2cf9 commit 65f702eCopy full SHA for 65f702e
lab-12/random-number-file.py
@@ -0,0 +1,12 @@
1
+import random
2
+import os
3
+
4
+def random_file(file_path):
5
+ file_write = open(file_path, "a+")
6
+ file_read = open(file_path, "r")
7
+ for i in range(100):
8
+ file_write.write(f" {str(random.randint(0, 100))} ")
9
+ print(file_read.read())
10
+ open(file_path).close()
11
12
+random_file(os.path.expanduser('~') + "\\src\\python-programming\\lab-12\\test.txt")
0 commit comments