Error is not supported between instances of str and int

0 votes
My code is if dis < 0.5:
       Print('  ')
Here dis values is 1.13

My error is '<' not supported between instances of str and int

Can anyone tell me how to overcome this:
Nov 15, 2020 in Python by Rajiv
• 8,880 points
1,287 views

1 answer to this question.

0 votes

your dis is obviously not 1.13, it's "1.13", so put it in float().

And one of those is a string. An 0.5 is for sure float.

answered Nov 15, 2020 by Gitika
• 65,870 points

Related Questions In Python

0 votes
1 answer

What is the difference between str() and repr() functions in Python?

str() is mostly used to create output ...READ MORE

answered Jul 8, 2019 in Python by Arvind
• 2,980 points
676 views
0 votes
1 answer

i am normalizing the data set iris in python and get the error ::TypeError: 'numpy.float64' object is not callable

TRY THIS   #Nomalisation for i in names:     print(i)   ...READ MORE

answered Aug 19, 2019 in Python by Noel Deepak Palle
4,061 views
0 votes
1 answer
+1 vote
4 answers

How can I concatenate str and int objects?

If you want to concatenate int or ...READ MORE

answered Oct 18, 2018 in Python by subhm
247 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,833 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,810 points
1,416 views
0 votes
5 answers