Following code intends to obtain a number in variable x and then print its 5 multiples i.e., x, 2x, 3x, 4x, and 5x. Fill in the missing functionality and run your code.
# to obtain a number and print its 5 multiples
x = ___ (input ('__________'))
multiple1 = ____
multiple2 = ____
multiple3 = x* 3
multiple4 = ____
multiple5 = ____
print ('x =', ____)
print (_____________)
Alternative code
# to obtain a number and print its 5 multiples
x = ___ (input (' ______'))
print ('x =', ______)
print (x, ____, ____, ____, ____,)
Output produced by above code (First Alternative)
Output produced by above code (Second Alternative).
Answer =
x = int (input ("Enter the number :- "))
multiple1 = x * 1
multiple2 = x * 2
multiple3 = x * 3
multiple4 = x * 4
multiple5 = x * 5
print ('x =', x)
print (multiple1, multiple2, multiple3, multiple4, multiple5)
Alternative code
x = int (input ('Enter the Number:- '))
print ('x =', x)
print (x, x * 2, x * 3, x * 4, x * 5,)
Output produced by above code (First Alternative):-
Enter the number :- 5
x = 5
5 10 15 20 25
>>>
Output produced by above code (Second Alternative):-
Enter the number :- 5
x = 5
5 10 15 20 25
>>>
🙏🏻
ReplyDeleteWelcome : )
Deletethanks
ReplyDeleteWelcome : )
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )