เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Writing a function with multiple arguments

In the last exercise, you wrote a function that returns the first letter of a student's grades. However, you would like a function that can be used to extract any of the student's grades.

For each student, you have text data that looks like this:

grades = "XXXX"

Where the letters "XXXX" are the grades for the student in mathematics, history, science, and drama, respectively.

A single string of grades named mygrades and an array of grade strings named grades_array is available in your environment.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Introduction to Julia

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# Create the get_gradenumber function
____ ____(____)
	____ ____
____
แก้ไขและรันโค้ด