The Joy of Computing using Python - Week 3
Quiz Week 3: Assignment 3
Solution
1. Which of the following is/are true statement(s)?
Answer: [Option 1] & [Option 3] Lists are used to store multiple values. & Iterating over lists is possible in Python.
2. In below code:
3. From the previous question, for what values of n is the number 7 appended to list a.
Answer: [Option 3 & 4] 8 & 9
4. What does the following code perform ?
Answer: [Option 2] It converts any input list into a new list such that at even indices, the value is a multiple of an even number and at odd indices, the value is either odd or even number.
5. From the previous question, if the option -It converts any input list into a new list which is filled with some alternative even and odd numbers. is incorrect, Can you make changes to code such that this option is true ?
Answer: [Option 3] Yes, we can make changes.
7. Which of the following are examples of Social Computing ?
Answer: [Option 1, 2 & 3] StackOverflow, Wikipedia, Quora
8. What does the following code print for n = 3?
Answer: [Option 1] WE KNOW THE WISDOM OF SERIES
Answer: [Option 1] No, it is not dependent on variable n, the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
[Option 4] No, it is not dependent on a.sort(), the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
10. What does the code in question 8, calculate ? Can you say what the values of k and b are if n =10294343763482 x 102309. If values of k and b are different, enter 0, else enter value of k.
Answer: 56
Comments
Post a Comment