4 Answers
New Answerlet var = readLine() readLine returns an optional string. When calling it print ex. print(varname!) , include the ! to refrain it from being an optional. If you dont it will say optional(“valueofvar”) Hope this helps
In comparison to other languages like C# and java it’s kind of similar, C++ is special, also is considered a high level language, swift not so much
Thats a bit confusing I mean thanks for the explanation, but I still dont get it. Why is input so complicated in Swift, C++ is harder than swift and all what you have to do is to type cin>> and then you do input from the keyboard.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message