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

Writing your own functions

You've seen how to write functions. Now it's time to practice and write your own. In this exercise, you'll be writing a function to calculate the cost of a customer's order. Pre-defined is a dictionary restaurant_menu with menu items as keys and their corresponding prices as values, and you, as the restaurant owner, want to use this dictionary mapping to calculate the total price of a customer's order.

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

Intermediate Julia

Xem khóa học

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 a function calculate_order_cost that takes in items
function ____(____)

end
Chỉnh sửa và Chạy Mã