-
-
Save racterub/1795a3269352961a6b49dd5e81e7b0f7 to your computer and use it in GitHub Desktop.
123132
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/lib/env python | |
f = open('data', 'w+') | |
s = {} | |
for line in f: | |
k, v = line.strip().split('=') | |
s[k.strip()] = v.strip() | |
for i in random.sample(a.items(), 3): | |
f.write(str(i) + "\n") | |
f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/lib/env python | |
#open data | |
f = open('data', 'r') | |
s = {} | |
#turn data in to dict | |
for line in f: | |
k, v = line.strip().split('=') | |
s[k.strip()] = v.strip() | |
f.close() | |
#create and write result | |
f = open('result.txt', 'w') | |
f = open('data', 'w+') | |
for i in random.sample(s.items(), 3): | |
f.write(str(i) + "\n") | |
f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 = "eadad" | |
2 = "dgsgsg" | |
3 = "fhaha" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment