Bắt đầu ngayBắt đầu miễn phí

Creating arrays

Arrays are a great solution to storing and processing a large amount of data, particularly when that data is all of the same data types.

Previously you wrote a script to process your working hours throughout the week. That script would become hard to work with as you gathered more and more data. What if you wanted to process your work hours over an entire month? In this exercise, you will practice creating arrays to store that data.

The hours you worked in the previous week:

  • Monday : 9
  • Tuesday : 7.5
  • Wednesday : 8
  • Thursday : 9.5
  • Friday : 7

Bài tập này là một phần của khóa học

Introduction to Julia

Xem khóa học

Hướng dẫn bài tập

  • Create an array of all of the days of the week from "Monday" to "Friday".
  • Create an array of the hours you worked from Monday to Friday.
  • Print the type of the week_days array.
  • Print the type of the hours_worked array.

Bài tập tương tác thực hành trực tiếp

Hãy thử làm bài tập này bằng cách hoàn thành đoạn mã mẫu này.

# Create array of the days of the week
week_days = ____

# Create array of hours worked
hours_worked = ____

# Print the type of the week days arrays
println(____)

# Print the type of the hours worked array
println(____)
Chỉnh sửa và Chạy Mã