Variables Output#

Section Title: Variables Output

  • Find the output of the following code.

  • Please don’t run the code before giving your answer.     

Question-1#

print(type(5))

Solution

<class ‘int’>

Question-2#

print(type(5.5))

Solution

<class ‘float’>

Question-3#

print(type(5.0))

Solution

<class ‘float’>

Question-4#

print(type('5'))

Solution

<class ‘str’>

Question-5#

x = 5
y = 'apple'
print('I have', 20-x, y,'s.')

Solution

I have 15 apple s.

Question-6#

age = 25
print('I am' +'age'+'years old.')

Solution

I amageyears old.

Question-7#

age = 25
print('I am' +str(age)+'years old.')

Solution

I am25years old.