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:


For what value of n does the program print 21 ?

Answer: [Seven] 7

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.

6. If file.txt exists, Does the code successfully run ?


AnswerNo 

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

9. From the previous question, is the variable n or a.sort() responsible for printing of either of the two possible sentences ?

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.

Answer56

Discussion makes the solution more accurate ( social computing ) discuss the solution in comments. Do share this with your friends !! Comment the queries, I will reach out to you.
Week 3 programming assignment solution coming soon ☺......

Comments

Popular posts from this blog

The Joy of Computing using python -Week 1