<jupyter_start><jupyter_text>Python Intro Exercises - SolutionThis exercise allow you to practices the basics of python  ExercisesSolve each question  7 to the 4th power?<jupyter_code>7 ** 4<jupyter_output><empty_output><jupyter_text>Use the split() method to convert the next phrase to a list    s = "Hi there Sam!"<jupyter_code>s = 'Hi there Sam!'
s.split()<jupyter_output><empty_output><jupyter_text>planet = "Earth"    diameter = 12742 Use the .format() method to print the next text    The diameter of Earth is 12742 kilometers.<jupyter_code>planet = "Earth"
diameter = 12742
print("The diameter of {} is {} kilometers.".format(planet,diameter))<jupyter_output>The diameter of Earth is 12742 kilometers.<jupyter_text>From the next nested list print the word "hello"<jupyter_code>lst = [1,2,[3,4],[5,[100,200,['hello']],23,11],1,7]
lst[3][1][2][0]<jupyter_output><empty_output><jupyter_text>Bonus From the next dictionary print the word "hello"<jupyter_code>d = {'k1':[1,2,3,{'tricky':['oh','man','inception',{'target':[1,2,3,'hello']}]}]}
d['k1'][3]['tricky'][3]['target'][3]<jupyter_output><empty_output><jupyter_text>Which is the difference between list and tuple<jupyter_code># Tuple is immutable<jupyter_output><empty_output><jupyter_text>Create a function that takes an email as an input and pritn print the server    <EMAIL>    **Example, "<EMAIL>" returns: domain.com**<jupyter_code>def domainGet(email):
    return email.split('@')[-1]
domainGet('<EMAIL>')<jupyter_output><empty_output><jupyter_text>Create a function that returns True if the word "dog" is in the phrase the user add.<jupyter_code>def findDog(st):
    return 'dog' in st.lower().split()
findDog('Is there a dog here?')<jupyter_output><empty_output><jupyter_text>Create a function that counts the number of times the word "dog" is in the phrase<jupyter_code>def countDog(st):
    count = 0
    for word in st.lower().split():
        if word == 'dog':
            count += 1
    return count
countDog('This dog runs faster than the other dog dude!')<jupyter_output><empty_output><jupyter_text>Bonus Use the lambda() and filter() methods to filtered the words that start with the letter "s", example:    seq = ['soup','dog','salad','cat','great'] result:    ['soup','salad']<jupyter_code>seq = ['soup','dog','salad','cat','great']
list(filter(lambda word: word[0]=='s',seq))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1486146095717884, 'fraction_numerical': 0.02518891687657431, 'mean_word_length': 6.662379421221865, 'pattern_counts': {'":': 0, '<': 43, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '5906', 'license': 'MIT', 'n_tokens_mistral': 859, 'n_tokens_neox': 818, 'n_words': 216, 'path': 'Basico/Python_Intro_Exercises-Solution.ipynb', 'repo_name': 'jorgemauricio/python', 'size': '2406'}