subject

Consider the following dictionary Marks and answer the questions from (i) to (iv). Marks={“Lina”:80, “Fatima”:75, “Priya”:82}
(i) Ms. Shoba wants to change the name Lina to Linda. Is it allowed in python?
If no, state the reason. 1
(ii) Help her to select the command to get all the marks from the dictionary. 1
a) Marks. value()
b) Marks. values()
c) Marks. items()
(iii) She needs to change the mark of Priya to 87. Help her choose the command
to do so. 1
a) Marks. update[Priya:87]
b) Marks[Priya]=87
c) Marks[“Priya”]=87
(iv) She wanted to add a new student “Nithya” with marks 66 . she used the following command and got error. 1
Marks. append[“Nithya”]=66
Help her to write the correct command.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:00
The most efficient way to establish top best possible economize position is to measure
Answers: 1
question
Computers and Technology, 22.06.2019 01:00
)a grad student comes up with the following algorithm to sort an array a[1..n] that works by first sorting the first 2/3rds of the array, then sorting the last 2/3rds of the (resulting) array, and finally sorting the first 2/3rds of the new array. 1: function g-sort(a, n) . takes as input an array of n numbers, a[1..n] 2: g-sort-recurse(a, 1, n) 3: end function 4: function g-sort-recurse(a, `, u) 5: if u ⒠` ≤ 0 then 6: return . 1 or fewer elements already sorted 7: else if u ⒠` = 1 then . 2 elements 8: if a[u] < a[`] then . swap values 9: temp ↠a[u] 10: a[u] ↠a[`] 11: a[`] ↠temp 12: end if 13: else . 3 or more elements 14: size ↠u ⒠` + 1 15: twothirds ↠d(2 ◠size)/3e 16: g-sort-recurse(a, `, ` + twothirds ⒠1) 17: g-sort-recurse(a, u ⒠twothirds + 1, u) 18: g-sort-recurse(a, `, ` + twothirds ⒠1) 19: end if 20: end function first (5 pts), prove that the algorithm correctly sorts the numbers in the array (in increasing order). after showing that it correctly sorts 1 and 2 element intervals, you may make the (incorrect) assumption that the number of elements being passed to g-sort-recurse is always a multiple of 3 to simplify the notation (and drop the floors/ceilings).
Answers: 3
question
Computers and Technology, 22.06.2019 08:00
What is the algorithm for building a binary tree program
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
Awide variety of “ apps “ are available to customize devices. which category of app does the word processing software fall into?
Answers: 2
You know the right answer?
Consider the following dictionary Marks and answer the questions from (i) to (iv). Marks={“Lina”:80...
Questions
question
Mathematics, 26.02.2021 16:40
question
Social Studies, 26.02.2021 16:40
question
Mathematics, 26.02.2021 16:40
Questions on the website: 13722363