Marie.B.B
(Marie B. B.)
1
Thank you for your help.
I am receiving the following error messages in the playground and don't know why yet:
expression failed to parse:
error: Exercise-Using Return Values.xcplaygroundpage:39:21: error: cannot convert value of type '(Int, Int, Int) -> Int' to specified type 'Int'
let rresult : Int = impossibleBeliefsCount
^~~~~~~~~~~~~~~~~~~~~~
error: Exercise-Using Return Values.xcplaygroundpage:44:24: error: cannot convert value of type '(Int, String) -> String' to specified type 'String'
let printme : String = impossibleThingsPhrase
^~~~~~~~~~~~~~~~~~~~~~
For the following code:
func impossibleBeliefsCount
( pigsFlying: Int,
frogsBecomingPrinces: Int,
multipleLightningStrikes: Int)
-> Int
{
let total = pigsFlying + frogsBecomingPrinces + multipleLightningStrikes
return (total)
}
func impossibleThingsPhrase(
numberOfImpossibleThings : Int,
meal : String )
-> String
{
// let numberOfImpossibleThings = 10
// let meal = "teatime"
return "Why, I've believed as many as (numberOfImpossibleThings) before (meal)"
}
let rresult : Int = impossibleBeliefsCount
(pigsFlying: 1,
frogsBecomingPrinces: 2,
multipleLightningStrikes: 3)
let printme : String = impossibleThingsPhrase
(numberOfImpossibleThings : rresult,
meal : "TEATIME")
print ( rresult )
print ( printme )
...
Help is greatly appreciated!
let printme : String = impossibleThingsPhrase
(numberOfImpossibleThings : rresult,
meal : "TEATIME")
You are putting a newline before the opening parenthesis (, try it like this:
let printme : String = impossibleThingsPhrase(
numberOfImpossibleThings : rresult,
meal : "TEATIME"
)
Marie.B.B
(Marie B. B.)
3
That worked! Thank you, costinAndronache!
I was thinking newline acted like a neutral space character?
When actually newline acts more like a line delimiter semicolon?
(Or sometimes one and sometimes the other based on context?)
Thanks, again.