- #1
Brown Arrow
- 101
- 0
im reading a book intro to python, I am confused by what is ment by the following
>>>-17/10
-2
i do not understand this explain pls
NOT A HW
>>>-17/10
-2
i do not understand this explain pls
NOT A HW
Python is a widely-used programming language that was first released in 1991. It is known for its simplicity, versatility, and readability, making it a popular choice for beginners and experienced programmers alike.
The minus (-) operator is used for subtraction, the forward slash (/) operator is used for division, and the percent (%) operator is used for modulus (finding the remainder after division).
To use the minus operator in Python, you simply place it between two numbers or variables that you want to subtract. For example, 10 - 5 will result in 5.
Yes, the / operator can be used with both integers and floats. However, when used with integers, it will always return a whole number (integer) as the result.
To use the % operator, simply place it between two numbers that you want to divide and find the remainder of. For example, 10 % 3 will result in 1, as 10 divided by 3 leaves a remainder of 1.