Computer Science
The record of a student (Name, Roll No, Marks in five subjects and percentage of marks) is stored in the following list:
stRecord = ['Raman', 'A-36', [56, 98, 99, 72, 69], 78.8]
Write Python statements to retrieve the following information from the list studRecord.
(i) Percentage of the student
(ii) Marks in the fifth subject
(iii) Maximum marks of the student
(iv) Roll No. of the student
(v) Change the name of the student from 'Raman' to 'Raghav'.
Python List Manipulation
3 Likes
Answer
(i) percentage = stRecord[3]
(ii) marks_5 = stRecord[2][4]
(iii) max_marks = max(stRecord[2])
(iv) Roll_No = stRecord[1]
(v) stRecord[0] = 'Raghav'
Answered By
2 Likes
Related Questions
WAP to shift elements of a list so that first element moves to the second index and second index moves to the third index, etc., and last element shifts to the first position.
Suppose list is [10, 20, 30, 40]
After shifting it should look like: [40, 10, 20, 30]
An array Num contains the following elements:
3, 25, 13, 6, 35, 8, 14, 45
Write a function to swap the content with next value divisible by 5 so that the resultant array looks like:
25, 3, 13, 35, 6, 8, 45, 14
What will be the status of the following list after fourth pass of insertion sort and fourth pass of bubble sort used for arranging elements in ascending order?
12, 14, -54, 64, 90, 24
Write the steps to arrange the following elements using insertion sort:
12, 5, 14, 8, 3, 54, 25, 10, 27, 30