Input and Output Output#

Section Title: IO Output

  • Find the output of the following code.

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

Question-1#

name = 'Liz'
print('name')

Solution

name

Question-2#

number = 49
print(number-10)

Solution

39

Question-3#

print('Michael'+'Jordan')

Solution

MichaelJordan

Question-4#

print('Michael'+''+'Jordan')

Solution

MichaelJordan

Question-5#

print('Michael'+' '+'Jordan')

Solution

Michael Jordan

Question-6#

print('Michael', 'Jordan')

Solution

Michael Jordan

Question-7#

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

Solution

I amageyears old.

Question-8#

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

Solution

I am25years old.

Question-9#

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

Solution

I have 15 apple s.

Question-10#

number = input('What is your favorite number: ')
print('number')

Solution

number

Question-11#

print('Hel\nlo')

Solution

Hel
lo

Question-12#

print('Hel\tlo')

Solution

Hel    lo

Question-13#

print('Hel\blo')

Solution

Helo

Question-14#

print('TEX\b\bAS')

Solution

TAS

Question-15#

print('CA\nLIFO\tRN\bIA')

Solution

CA
LIFO     RIA

Question-16#

x = '5'
y = '7'
print(x+y)

Solution

57

Question-17#

print('H',2,3,'BYE', sep='++')

Solution

H++2++3++BYE

Question-18#

print('H',2,3,'BYE', sep='xxxx', end='?')

Solution

Hxxxx2xxxx3xxxxBYE?

Question-19#

print('A')
print('B', end='--')
print('C')
print('D', end='??')
print('E')

Solution

A
B–C
D??E

Question-20#

print('A', 'A', 'A', sep='8', end='K')
print('B', 'B', sep='--', end='L')
print('C')
print('D')

Solution

A8A8AKB–BLC
D