m = 20
n = 4
result = m // n
print(result)
#source code --> clcoding.com
Step-by-Step Explanation
Step 1: Storing the Numbers
m = 20
n = 4
We create two integer variables:
m is assigned the value 20
n is assigned the value 4
Step 2: Performing Integer Division
result = m // n
Here, // is the integer division operator.
It divides m by n, but only keeps the whole number (quotient) and ignores the remainder.
Let's divide 20 by 4:
Normal division: 20 ÷ 4 = 5.0
Integer division (//): 5 (only the whole number, no decimals).
So, result stores the value 5.
Step 3: Printing the Result
print(result)
This tells Python: "Show me the value inside result!"
The output on the screen will be:
5
Final Output
5
0 Comments:
Post a Comment