x = input() y = int(input()) print(x * y)
- 333333
- 666
- 36
- 18
Explanation: Let’s analyze this example:
the x variable is assigned the value of “3” (3 is inputted by the user and converted to a string by the input() function)
the y variable is assigned the value of 6 (6 is inputted by the user, converted to a string by the input() function, and then converted to an integer by the int() function)
the print() function outputs the result of the following string multiplication: “3” * 6, that is 333333
More Questions: Python Essentials 1 – Module 2 Test
Please login or Register to submit your answer