85.1k views
4 votes
Consider the following code: x = 17 y = 5 print (x % y) What is output?

User FBronner
by
5.0k points

1 Answer

3 votes

Answer:

The output to given python code is "2".

Explanation:

The description of the python program as follows:

  • In the given code, two variable is defined that is, x and y in which contain assign value that is 17 and 5.
  • In this code, variable x modules variable y that is (x%y). In python or any other programming language, modules (%) will give a remainder that is "2".
  • To print calculated value we use a print function, that prints its value.
User Kunjan Thadani
by
5.4k points