NPTEL The Joy of Computing using Python Week 3 Assignment Answers 2024
1. Which of the following is/are true statement(s)?
- Lists are used to store multiple values.
- One can access element in list by using non-numeric indices.
- Iterating over lists is possible in Python.
- We need to specify required size of list while creating a new list variable.
Answer :- For Answers Click Here
2. In the below code –
For what value of n does the program print 21 ?
Answer :- For Answers Click Here
3. From the previous question, for what values of n is the number 7 appended to list a.
- 7
- 6
- 8
- 9
Answer :-
4. What does the following code perform ?
- It converts any input list into a new list which is filled with some alternative even and odd numbers.
- 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.
- It converts any input list into a new list such that at even indices, the value is multiple of 2 and at odd indices, the value is multiple of 3.
- It converts any input list into a new list, which follows no pattern.
Answer :- For Answers Click Here
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 ?
- No, it is not possible to make such changes.
- No, the option is already correct.
- Yes, we can make changes.
Answer :-
6. If file.txt exists, Does the code successfully run ?
- Yes
- No
Answer :-
7. Which of the following are examples of Social Computing ?
- StackOverflow
- Wikipedia
- Quora
- None
Answer :- For Answers Click Here
8. What does the following code print for n = 3?
- WE KNOW THE WISDOM OF SERIES
- WE ARE YET TO KNOW MANY THINGS
Answer :-
9. From the previous question, is the variable n or a.sort() responsible for printing of either of the two possible sentences ?
- No, it is not dependent on variable n, the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
- Yes on a.sort() only, but the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
- Yes on both, the code may print both sentences.
- No, it is not dependent on a.sort(), the code will never print ”WE ARE YET TO KNOW MANY THINGS”.
Answer :-
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 :- For Answers Click Here