Skip to content

Commit

Permalink
Improved bad example in high-score-board introduction (#509)
Browse files Browse the repository at this point in the history
var emptyDict2 = ["Character": "String"]() generates an error.
Correct declaration of empty dictionary is:
var emptyDict2 = [Character: String]()
  • Loading branch information
raxavelo authored Nov 12, 2021
1 parent 06a16e9 commit eeba8f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/concept/high-score-board/.docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var addresses: Dictionary<String, String> = ["The Munsters": "1313 Mockingbird L
var sequences: [String: [Int]] = ["Euler's totient": [1, 1, 2, 2, 4, 2, 6, 4], "Lazy caterer": [1, 2, 4, 7, 11, 16, 22, 29, 37], "Carmichael": [561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841]]
let constants = ["pi": 3.14159, "e": 2.71828, "phi": 1.618033, "avogadro": 6.02214076e22]
var emptyDict1: [Int: Int] = [:]
var emptyDict2 = ["Character": "String"]()
var emptyDict2 = [Character: String]()
var emptyDict3 = Dictionary<Int, Double>()
```

Expand Down

0 comments on commit eeba8f8

Please sign in to comment.