开始使用免费开始使用

Julia as a calculator

Writing your code into a script instead of the console means you will have it saved for later. This allows you to rerun the code, modify it and run it with different inputs, or check for any mistakes in the code you used earlier.

Here you are writing a script to keep track of your weekly hours worked. You have been adding to it every day to get a total.

本练习是课程的一部分

Introduction to Julia

查看课程

练习说明

  • Add the comment Hours worked this week to line 2 of the script.
  • Add all the numbers 39, 37.5, 40, and 42 together to calculate your total hours worked.

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Add the comment on the line below
____

# Add the hours worked
____
编辑并运行代码