NPTEL Joy Of Computing Using Python Week 1 Assignment Answer

 

Week 1 : Assignment 1

Due date: 2025-02-05, 23:59 IST.
Assignment not submitted
1 point

Q1. Which blocks can be used to move the cat?

 A. Walk

 B. Move

 C. Teleport

 D. Glide

Answer: [ B ]

Q2. Which set of blocks moves the cat 40 steps and then points down ?

Answer: [ B ] 



In Case 2, the cat towards down with 40 Steps. So Option B is Correct.

Q3. What does the cat say here ?

What does the cat say here ?


A. Says the number 7, for 1 second, 7 times and changes the value of number variable by multiplying previous value with 1.

B. Says the number 7, for 1 second, 7 times and changes the value of number variable by adding previous value with 1.

C. Says the number 7, for 1 second, then says numbers from 6 to 1 one by one for 1 second each.

D. Says the number 7, for 1 second, then says numbers from 6 to 0 one by one for 1 second each.

Answer: [ C ] 

Here the answer is Option C. Whenever it starts, it start from 7 such that the counting be 7,6,5,4,3,2,1 and it ends there.

Q4. From the previous question, what is the value of myNum variable after the loop ends ?

 A. 1

 B. 2

 C. 7

 D. 0

Answer:  [ D ] The last Value end by the myNum will be 0.

Q5. Let answer for previous question be stored in variable x, what does the cat say after the execution of the loop ?

A. 16

B. 5

C. 29

D. 44

Answer: [ B ] 

Q6. Which of the following data types is primarily used for storing a sequence of characters in most programming languages?

A. Integer

B. Float

C. String

D. Boolean

Answer: [ C ] 

Q7. Which of the following statements best describes why loops are commonly used ?

A. Loops make the code run slower but more reliably.

B. Loops allow you to execute a block of code repeatedly without having to write it multiple times.

C. Loops are only useful for error handling.

D. Loops automatically convert variables from one data type to another.

Answer: [ B ] 

Q8. Suppose you have an arithmetic expression involving addition, subtraction, multiplication, and exponentiation. Which statement is true about instructing a computer to evaluate it?

A. Such expressions cannot be computed.

B. A computer can only evaluate expressions involving addition and multiplication.

C. These expressions can be evaluated using built-in operations or libraries.

D. A computer can only evaluate expressions involving addition and subtraction.

Answer: [ C ] 

Q9. In which of the following code blocks calculation of the squared distance between two points (15, 25) and (20, 19) is accomplished.

Answer: [ A ] 

Q10. What task does the block below accomplish ?

A. Moves the ball in a parabolic path and stops 18 away steps from center(0, 0) in x direction.

B. Moves the ball in a circular path and 18 times.

C. Moves the ball in a parabolic path and stops 18 away steps from center(0, 0) in y direction.

D. Moves the ball in a parabolic path and stops 17 away steps from center(0, 0) in x direction.

Answer: [ A ] 

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Ok, Go it!