var studentScores = ["Alice": 85, "Bob": 92, "Charlie": 78, "David": 95]
var studentScores: [String: Int] = ["Alice": 85, "Bob": 92, "Charlie": 78, "David": 95]
print("Alice's score is \(studentScores["Alice"]!)")
print("Bob's score is \(studentScores["Bob"]!)")
studentScores["Eve"] = 88
studentScores["Charlie"] = 80
studentScores["David"] = nil
for (name, score) in studentScores {
print("\(name) scored \(score)")
}
if let score = studentScores["Charlie"] {
print("Charlie's score is \(score)")
} else {
print("Charlie's score is not available")
}