# Semicolons in Swift

> Learn why semicolons are optional in Swift, and the one case where you actually need one: writing more than one statement on the same line of code.

Author: Flavio Copes | Published: 2021-05-30 | Canonical: https://flaviocopes.com/swift-semicolons/

> This tutorial belongs to the [Swift](https://flaviocopes.com/swift-introduction/) series

In Swift, semicolons are optional.

You can write statements on separate lines, and you don't need to add a semicolon:

```swift
let list = ["a", "b", "c"]
var a = 2
```

You _can_ add a semicolon, but it adds nothing meaningful in this case:

```swift
let list = ["a", "b", "c"];
var a = 2;
```

But if you want to write more than one statement on the same line, then you need to add a semicolon:

```swift
var a = 2; let b = 3
```
