MCQs > IT & Programming > Swift > Compare the below code and what will result? import UIKit var rank:Dictionary = [1:'First', 2: 'Second', 3: 'Third']; rank.updateValue('Forth', forKey: 4);

Swift MCQs

Compare the below code and what will result?

import UIKit

var rank:Dictionary = [1:”First”, 2: “Second”, 3: “Third”];

rank.updateValue(“Forth”, forKey: 4);

rank[5]=”Fifth”;

for I in rank {

print(i);

}

import UIKit

var rank:Dictionary = [2:”Second”, 1: “First”, 3: “Third”];

rank[5]=”Fifth”;

rank.updateValue(“Forth”, forKey: 4);

for I in rank {

print(i)

}

Answer

Correct Answer: Output Result will be same

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Swift Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Swift Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it