diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3a6fa11 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Real Python + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/TODO.md b/TODO.md index 9358b94..9d2dfea 100644 --- a/TODO.md +++ b/TODO.md @@ -3,4 +3,3 @@ 1. Add support for Python 2.7, 3.5, and 3.6 1. Organize docs and folder structure better 1. Add all scripts to single CLI for easy running, testing, and searching -1. Add License diff --git a/readme.md b/readme.md index 59d5c64..78f4a72 100755 --- a/readme.md +++ b/readme.md @@ -32,4 +32,5 @@ 1. **30_fullcontact.py**: Call the [FullcContact](https://www.fullcontact.com/developer/) API 1. **31_youtube_sentiment.py**: Calculate sentiment score from the comments of a Youtube video 1. **32_stock_scraper.py**: Get stock prices +1. **33_country_code.py**: Convert country code to country name 1. **34_git_all_repos.py**: Clone all repositories from a public user or organization on Github. Usage: `python git_all_repos.py users USER_NAME` or `python git_all_repos.py orgs ORG_NAME` diff --git a/scripts/13_random_name_generator.py b/scripts/13_random_name_generator.py index 6f0a00a..0acb9bf 100755 --- a/scripts/13_random_name_generator.py +++ b/scripts/13_random_name_generator.py @@ -1,4 +1,4 @@ -from random import randint +from random import choice def random_name_generator(first, second, x): @@ -10,13 +10,8 @@ def random_name_generator(first, second, x): - number of random names """ names = [] - for i in range(0, int(x)): - random_first = randint(0, len(first)-1) - random_last = randint(0, len(second)-1) - names.append("{0} {1}".format( - first[random_first], - second[random_last]) - ) + for i in range(x): + names.append("{0} {1}".format(choice(first), choice(second))) return set(names)