시작하기무료로 시작하기

Indexing arrays

You have kept up your training regime to get faster over 5000m runs. After a few weeks of training regularly, you want to look back at your run times to see if your new times are better than your old ones.

The array of floats of your run times is available in your environment as runtimes.

이 연습은 강의의 일부입니다

Introduction to Julia

강의 보기

연습 안내

  • Select the first run time and assign it to the variable first_runtime.
  • Select the last run time and assign it to the variable last_runtime.
  • Calculate the difference in times by subtracting the last run time from the first.

실습형 인터랙티브 연습

이 예제를 이 샘플 코드를 완성하여 풀어보세요.

# Select the first run time
first_runtime = ____

# Select the last run time
last_runtime = ____

# Calculate the difference
time_diff = ____

println("Last run time was $time_diff minutes faster")
코드 편집 및 실행