Professional Documents
Culture Documents
Exercício - Trabalhar Com A Saída - Training - Microsoft Learn
Exercício - Trabalhar Com A Saída - Training - Microsoft Learn
" 100 XP
Todas as áreas restritas do Microsoft Learn estão em uso no momento. Aguarde de cinco a dez minutos e tente
novamente.
Para obter mais informações, confira a página de orientação para a solução de problemas.
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.
print(date.today())
Build a unit converter
Now it's time to turn your attention to the second utility, converting parsecs to lightyears. One parsec is 3.26 lightyears,
so you will multiply parsecs by that value to determine lightyears.
Create a variable named parsecs and set it to 11 . Then add the code to perform the appropriate calculation and
# Enter code below
store the result in a variable named lightyears . Finally print the result on the screen with so it displays a message
which resembles the following:
“
YourRemember to you
code should can use
resemble thestr to convert numbers to strings
following:
parsecs = 11
lightyears = parsecs * 3.26
print(str(parsecs) + " parsecs is " + str(lightyears) + " lightyears")
Desired output
When you run the notebook you should see the following result:
Continuar T