CBSE Class 11 Computer Science Question 70 of 98

Python Programming Fundamentals — Question 32

Back to all questions
32
Question

Question 21(c)

What will be the output produced by the following code fragment?

side = int (input ('side')) #Side given as 7
area = side * side
print (side, area)
Answer
Output
side7
7 49
Explanation
  1. side = int(input('side') ) ⇒ This statements asks the user to enter the side. We enter 7 as the value of side.
  2. area = side * side ⇒ area = 7 * 7 = 49.
  3. print (side, area) ⇒ prints the value of side and area as 7 and 49 respectively.