Please help me with the questions ASAP.
https://colab.research.google.com/drive/19Bu3OYFDU…
- Functions!
- Create a function (it has to be a function!) that generates passwords.
- Your function should have customizable default values for the parameters such as length, upper and lower case letters, or a requirement to include special characters in its parameters depending on your specifications. It is up to you to be creative with the requirements.
- Flexible programs net more points.
- Your function should accept empty calls (print(passwordGenerator())) and customizable values as well (passwordGenerator(length=12)).
- The function should return the password as a string.
- I recommend using the random library.
Be careful if you Google for help. It is not permissible to copy-paste complete solutions from online sources. Your code needs to be your own. If you use parts of other people’s code you found online (e.g. StackOverflow) add a link to where you got the code from as a comment in your code. For example, if you google for help with how to randomize the letters in your password generator, be inspired by the code you find, don’t copy-paste it, instead, rewrite it and use the parts you understand and then still link the original source.
If you are having a hard time with this question, write first the simplest possible password-generating function (e.g. returning random letters) and then expand on it. Any solution is better than no solution.
Don’t forget to comment your code!
- RegEx!
- Write a regex that detects Japanese style dates in text. (yyyy/mm/dd)
- Save these dates into a list and display the list. Only the dates themselves should be in the list, i.e not the other capture groups (week 10).
- You can use the following sample text.
- You are free to test your regex on regex101.com or other similar sites.
"There are a few dates here 2022/11/08 and also 2021/07/16 but not 06/27/2017 and also not 2022/31/03"
- Functions, lists, NLP!
- Read in the provided list (word list for exam on Moodle). Remember to get rid of the line breaks.
- Write a function that generates character trigrams for each word in the word list. I.e. if the word is “EVAPORATE”, the function should return [“EVA”,”VAP”,”APO”,”POR”,”ORA”,”RAT”,”ATE”] The final element in the list can be either “ATE” or “ATE”,”TE”, and “E” depending on how you write your code. Both are acceptable solutions. You want to save these trigrams as a list of lists (a list of tuples would also be acceptable) so that all the trigrams for all the words are in the list -> If you have a list of three words, your list should have three elements. All the elements should be trigram lists.
- Write a script that shows the 15 most common character trigrams of the English language based on your trigram list. You can write your own code or use NLTK. Both are acceptable solutions. The Wikipedia link above shows the most common trigrams but is based on text, not individual unique words, so don’t worry if your most common list is very different from the one on Wikipedia.