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

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

Answer / Vishal Srivastav

The '=' operator assigns a value to a variable. The '==' operator compares two values for equality.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How would you convert a string into an int in python?

1 Answers  


How is python different from java?

1 Answers  


What is pypi repository?

1 Answers  


What does ** (double star/asterisk) and * (star/asterisk) do for parameters?

1 Answers  


What are *args and *kwargs?

1 Answers  


Does python do until loop?

1 Answers  


What is anonymous function or lambda function?

1 Answers  


Does python allow you to program in a structured style?

1 Answers  


What happens when you execute python == python?

1 Answers  


What are negative indices?

1 Answers  


Is python better than matlab?

1 Answers  


In python, can you name the data science and machine learning libraries?

1 Answers  


Categories