Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift 2.0 Functions Function Parameters Function Parameters

yusuf Dibswazit
yusuf Dibswazit
1,522 Points

I know i'm wrong & close ..but where?

i'm lost when it tells me:- ((Call the function and pass in a value of 10 for the first parameter and 3 for the second))

and :-

Assign the result of the function operation to a constant named result.

functions.swift
// Enter your code below
func getRemainder(value a: Int, divisor b: Int) -> Int {
      return a % b
}
 getRemainder(10, b: 3 )
 let result = getRemainder

1 Answer

Really close. But the challenge editor wants you to use the external names when you call the function:

func getRemainder(value a: Int, divisor b: Int) -> Int {
      return a % b
}
 getRemainder(value: 10, divisor: 3 )
 let result = getRemainder

Actually, to be more precise, swift requires you to use external names if there are any. So it's not just the editor.