Professional Documents
Culture Documents
19 Exercício - Transformar Texto Usando Métodos de Cadeia de Caracteres - Training - Microsoft Learn
19 Exercício - Transformar Texto Usando Métodos de Cadeia de Caracteres - Training - Microsoft Learn
" 100 XP
Uma área restrita fornece acesso a recursos gratuitos. Não haverá cobranças na sua assinatura pessoal. A área
restrita poderá ser usada somente para concluir o treinamento no Microsoft Learn. O uso por qualquer outro motivo
é proibido e poderá levar à perda permanente do acesso à área restrita.
A Microsoft fornece essa experiência de laboratório e o conteúdo relacionado para fins educacionais. Todas as
informações apresentadas são de propriedade da Microsoft e destinam-se exclusivamente à aprendizagem sobre os
produtos e os serviços abordados neste módulo do Microsoft Learn.
This exercise is broken into a series of steps. For each step you will be presented with the goal for the step, followed by
an empty cell. Enter your Python into the cell and run it. The solution for each step will follow each cell.
Interesting facts about the Moon. The Moon is Earth's only satellite. There are several interesting facts
about the Moon and how it affects life here on Earth.
On average, the Moon moves 4cm away from the Earth every year. This yearly drift is not significant enough
to cause immediate effects on Earth. The highest daylight temperature of the Moon is 127 C.
text = """Interesting facts about the Moon. The Moon is Earth's only satellite. There are several
interesting facts about the Moon and how it affects life here on Earth. On average, the Moon moves 4cm
away from the Earth every year. This yearly drift is not significant enough to cause immediate effects on
Earth. The highest daylight temperature of the Moon is 127 C."""
Separate the paragraph into sentences
In English each sentence ends with a period. You will use this to break the paragraph into difference sentences. Using the
split method to split the text into sentences by looking for the string . (a period followed by a space). Store the
result in a variable named sentences . Print the result.
['Interesting facts about the Moon', "The Moon is Earth's only satellite", 'There are several
interesting facts about the Moon and how it affects life here on Earth', '\nOn average, the Moon
moves 4cm away from the Earth every year', 'This yearly drift is not significant enough to cause
immediate effects on Earth', 'The highest daylight temperature of the Moon is 127 C.']
Desired output
When you run the cell you should see the following result:
['Interesting facts about the Moon', "The Moon is Earth's only satellite", 'There are several interesting
facts about the Moon and how it affects life here on Earth', '\nOn average, the Moon moves 4cm away from
the Earth every year', 'This yearly drift is not significant enough to cause immediate effects on Earth',
'The highest daylight temperature of the Moon is 127 C.']
Find keywords
You will finish your program by adding the code to find any sentences which mention temperature. Add code to loop
through the sentences variable. For each sentence, search for the word temperature . If the word is found, print the
sentence
Desired output
When run, the output should look like the following:
Continuar T