Chapter 1 Challenge #5

I received the following error message based on the code:
MyPlayground.playground note: expected an argument list of type ‘(Double, Double)’
let average: Double = (a + b) / 2.0

let a: Double = 10.0
let b: Double = 10.0
let average: Double = (a + b) / 2.0

I do not understand the error even though the code looks fine to me.

The above code works for me. Please run it again and let me know if you still have any issues with it. Thank you!

1 Like

I found out that I had another variable “a” in my playground when I did do other challenge from the book.
I think the error message wasn’t making sense to me. It should have said that the variable was already existed.

This topic was automatically closed after 166 days. New replies are no longer allowed.