programming in python language page 1
programming in python language
Fill in the answer in the blank.
Example 1. show message Input
name = input('What is your name?\n') jack
…….... ('Hello, %s' %name) Output
What is your name?
Hello, jack.
Example 2. show message Input
aname = input('What is your name?\n') Rose
print ('Hello, %s' % ……………) Output
Hello, Rose
Example 3. show message Input
…………… = input('What is your name?\n') Mos
print ('Hello, %s' % aname) Output
Hello, Mos
Example 4. show numbers Input
number=int(input ('Input Number: ')) 5
print ('your number, %d ' %.................) Output
Input Number:
your number, 5
Example 5. show numbers Input
a = int(input('Input Number a = ')) 5
b = int(input('Input Number b = ')) 6
print('your number = ',…….. , ………) Output
your number = 5 6
Example 6. show numbers Input
a = int(input('Input Number a = ')) 3
b = ………….(input('Input Number b = ')) 4
print('your number a+b = ',……….+………..) Output
'your number a+b = 7
programming in python language page 2
Answer Example 1 - Example 6
Example 1. show message Input
name = input('What is your name?\n') jack
print ('Hello, %s' %name) Output
What is your name?
Hello, jack.
Example 2. show message Input
aname = input('What is your name?\n') Rose
print ('Hello, %s' % aname) Output
Hello, Rose
Example 3. show message Input
aname = input('What is your name?\n') Mos
print ('Hello, %s' % aname) Output
Hello, Mos
Example 4. show numbers Input
number=int(input ('Input Number: ')) 5
print ('your number, %d ' % number) Output
Input Number:
your number, 5
Example 5. show numbers Input
a = int(input('Input Number a = ')) 5
b = int(input('Input Number b = ')) 6
print('your number = ', a , b) Output
your number = 5 6
Example 6. show numbers Input
a = int(input('Input Number a = ')) 3
b = int(input('Input Number b = ')) 4
print('your number a+b = ', a+b) Output
'your number a+b = 7