What is the difference between = and == in python?

Answers were Sorted based on User's Feedback



What is the difference between = and == in python?..

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

What is the difference between = and == in python?..

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

What is the difference between = and == in python?..

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

Post New Answer

More Python Interview Questions

Is Python good for backend?

0 Answers  


How do you convert a number into a string?

0 Answers  


Which laptop is best for python programming?

0 Answers  


Explain about pickling and unpickling?

0 Answers  


What is dynamic typing in python?

0 Answers  






Write a code to display the current time.

0 Answers  


Is javascript harder than python?

0 Answers  


What is a cast in python?

0 Answers  


Can python handle big data?

0 Answers  


Can I use python instead of javascript?

0 Answers  


How do I run Apache in Python?

0 Answers  


What is a lambda statement? Provide an example.

1 Answers  


Categories