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,910 points
5,293 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,910 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
• 3,040 points
1,390 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 20, 2019 in Python by Noel Deepak Palle
5,521 views
0 votes
1 answer
0 votes
1 answer

Error: 'int' object is not subscriptable - Python

The issue is in the line: int([x[age1]]) The solution ...READ MORE

answered Apr 30, 2022 in Python by narikkadan
• 63,420 points
1,354 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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,059 views
0 votes
1 answer
+5 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,790 points
3,479 views
0 votes
5 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP