Questions

3 Marks Each

🎯

Test yourself on this topic

11 questions · timed · auto-graded

Question 23 Marks
Write definition of a method OddSum(NUMBERS) to add those values in the list of NUMBERS, which are odd.
View full question & answer
Question 33 Marks
What will be the status of the following list after the First, Second and Third pass of the bubble sort method used for arranging the following elements in descending order ?

Note: Show the status of all the elements after each pass very clearly underlining the changes. 152, 104, -100, 604, 190, 204

Answer

152, 104, -100, 604, 190, 204

pass-I

152 104 –100 604 190 204
152 104 –100 604 190 204
152 104 –100 604 190 204
152 104 604 –100 190 204
152 104 604 190 –100 204
152 104 604 190 204 –100

pass-II


152 104 604 190 204 –100
152 104 604 190 204 –100
152 604 104 190 204 –100
152 604 104 190 204 –100
152 604 190 104 204 –100
152 604 190 204 104 –100

pass-III

152 604 190 204 104 –100
604 152 190 204 104 –100
604 190 152 204 104 –100
604 190 204 152 104 –100
View full question & answer
Question 43 Marks
Write a user defined function arrangelements(X),that accepts a list X of integers and sets all the negative elements to the left and all positive elements to the right of the list.

For example:
if L =[1,-2,3,4,-5,7] ,
Then the output should be: [-2,-5,3,4,7]

View full question & answer
Question 73 Marks
Write a Python program to accept the list from the user and print the odd position elements of the list.
View full question & answer
3 Marks Each - Computer Science STD 12 Science Questions - Vidyadip