[Week 1-12] NPTEL The Joy of Computing using Python Assignment Answers 2024

1. Which of the following best defines a variable in programming?

  • A constant value that cannot be changed during program execution.
  • A named storage location that can hold varying data during program execution.
  • An operation that performs arithmetic calculations on data.
  • A reserved word is used to define a function or method in a program.

Answer :- b

2. Humans easily get bored doing a repetitive job. However, computers are masters of iteration. In programming, we get a control structure that allows a set of instructions to be executed repeatedly based on a condition. It enables automating repetitive tasks by iterating through a block of code until a specific condition is met or for a defined number of times. What is this control structure called?

  • Variable
  • Operator
  • Loop
  • Data Type

Answer :- c

3. Programming logic is different from programming language. Programming languages are many, but programming logic almost remains the same across all programming languages. Which of the following is programming logic?

  • Python
  • C
  • C++
  • None of the above

Answer :- d

4. Open-source software, unlike proprietary software, is computer software developed through public, collaborative efforts and made freely available to the public. Which of the following programming languages is/are open source?

  • Java
  • Python
  • FORTRAN
  • Perl

Answer :- a, b, c, d

5. Knowing how to write a piece of code could help us get things done fast. Choose the areas where we can implement coding.?

  • Physics
  • Mathematics
  • Economics
  • Small Scale Business

Answer :- a, b, c, d

6.

The block of code displayed here is meant for the cat, what is the functionality of this code?

  • It brings the ball closer to the cat.
  • It makes the cat appear like kicking the ball.
  • It makes the cat tumble and rotate
  • The code throws an error.

Answer :- b

7. The block of code displayed here makes the cat rotate out of impact from the boomeranging ball, how many complete rotations does the cat make?

  • One
  • Two
  • Three
  • Four

Answer :- c

8. The block of code displayed here makes the cat rotate out of impact from the boomeranging ball, how many loops are there in total?

  • One
  • Two
  • Three
  • Four

Answer :- b

9. The block of code displayed here is meant for the ball, how many loops are there in total?

  • One
  • Two
  • Three
  • Four

Answer :- a

10. The block of code displayed here is meant for the ball, if the value beside repeat would have been 1 instead of 2, Select all the statements that explain the situation.

  • The Ball would not have returned to Cat.
  • Removing the loop from the code would have made no difference in the result.
  • The Ball would not have left its original position.
  • The code would throw an error

Answer :- a, b

0% Complete