What is the difference between = and == in python?
Answers were Sorted based on User's Feedback
Answer / nashiinformaticssolutions
While // denotes floor division (result is an integer), / denotes precise division (result is a floating point value). For instance:
5//2 = 2 5/2 = 2.5
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / nashiinformaticssolutions
- `/` is the true division operator that always returns a float result, even if both operands are integers.
```python
result = 7 / 3 # Returns 2.3333...
```
- `//` is the floor division operator, which returns the largest integer less than or equal to the result.
```python
result = 7 // 3 # Returns 2
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / glibwaresoftsolutions
- `/` is the true division operator that always returns a float result, even if both operands are integers.
```python
result = 7 / 3 # Returns 2.3333...
```
- `//` is the floor division operator, which returns the largest integer less than or equal to the result.
```python
result = 7 // 3 # Returns 2
```
| Is This Answer Correct ? | 0 Yes | 0 No |
What is the purpose of not in operator?
Where is python used in real world?
How many constructors can a class have?
How do I start learning python?
What are different ways to create an empty numpy array in python?
Can we use singleton functionality without making a singleton class in Python?
Name a few methods that are used to implement functionally oriented programming in python?
How many kinds of sequences are supported by python? What are they?
Write program to validate the email address in python?
Explain about python break, continue and pass?
Explain about zip() in python?
What is the difference between repr and str in python?