mirror of
https://github.com/InternLM/InternBootcamp.git
synced 2026-04-19 12:58:04 +00:00
init-commit
This commit is contained in:
commit
18a552597a
3461 changed files with 1150579 additions and 0 deletions
13
internbootcamp/bootcamp_utils/random_things.py
Executable file
13
internbootcamp/bootcamp_utils/random_things.py
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
import random
|
||||
with open('./internbootcamp/libs/data/words_alpha_370000.txt', 'r') as f:
|
||||
words = f.readlines()
|
||||
words = [w.strip() for w in words]
|
||||
def random_word():
|
||||
w = random.choice(words)
|
||||
while len(w) < 3:
|
||||
w = random.choice(words)
|
||||
return w
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
print(random_word())
|
||||
Loading…
Add table
Add a link
Reference in a new issue