Simple Exercise for data mining
Need help with this assignment?Get an original answer from a qualified tutor — from $10/page.
Get it written →1. my_var = 3 my_var = “foo” my_var = len Explain this above code is allowed to not allowed? What is the typy of my_var at the very end? def double_plus_y(x, y=4): return 2 * x + y for value in map(double_plus_y, [1,2,3,4]): print(value) Predict the output without running the code. Use list comphresion the questions from this point on. In [ ]: hogwarts_emails = [‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’, ‘[email protected]’ ] Hogwarts staff want to use the first part of each email as a username. Make a list of these usernames In [ ]: Let’s make a dictionary where the keys are the usernames and the values are email addresses In [ ]: To read a file, we use the open function. Using with avoids having to remember to close the file. The file path depends on your google drive folder structure. Write python code to find how many countries will be visited. In [4]: with open(‘/content/drive/MyDrive/datamining/travel.txt’, ‘r’) as md: for line in md: print(line) This summer I will be travelling. I will go to… Italy: Rome Greece: Athens England: London, Manchester France: Paris, Nice, Lyon Spain: Madrid, Barcelona, Granada Austria: Vienna I will probably not even want to come back! However, I wonder how I will get by with all the different languages. I only know English!
Get a plagiarism-free answer to this question
Send us your instructions and we’ll match you with the best writer in your subject.
- 100% human-written, zero AI
- Turnitin report included
- Confidential — we never share your data
- Free revisions & refunds