Learning Swift

Hello guys, I thought while I was learning swift, I should share with others! I will be constantly updating this tutorial, and please feel free to ask any questions!

You are viewing a single comment. View All

Hey do you know how to do inputs? For a project I have to input the price and it has to output the 18% tip of that.


Hi, to do inputs you must declare a variable and assign the value as readLine()

print("Enter your favorite programming language:")
let name = readLine()

print("Your favorite programming language is (name!).")

For more info goto:https://www.programiz.com/swift-programming/basic-input-output