Computer Science
What will be the output produced by following code fragment:
side = int(input('side') ) #side given as 7
area = side * side
print (side, area)
Python
Python Funda
39 Likes
Answer
Output
side7
7 49
Explanation
side = int(input('side') )
⇒ This statements asks the user to enter the side. We enter 7 as the value of side.area = side * side
⇒ area = 7 * 7 = 49.print (side, area)
⇒ prints the value of side and area as 7 and 49 respectively.
Answered By
19 Likes
Related Questions
What will be the output produced by following code fragment:
X = 10 X = X + 10 X = X - 5 print (X) X, Y = X - 2, 22 print (X, Y)
What will be the output produced by following code fragment:
first = 2 second = 3 third = first * second print (first, second, third) first = first + second + third third = second * first print (first, second, third)
What is the problem with the following code fragment?
a = 3 print(a) b = 4 print(b) s = a + b print(s)
What is the problem with the following code fragment?
name = "Prejith" age = 26 print ("Your name & age are ", name + age)