Error saying TypeError range integer end argument expected

0 votes

I am trying to execute this code in python but I end up with an error:

for X0 in range (-0.02, 0.02, 0.01):
     for Y0 in range (-0.06, 0.09, 0.01)

Error:

TypeError: range() integer end argument expected, got float.
May 27, 2019 in Python by Ishwar
1,290 views

1 answer to this question.

0 votes

Try this:

[x * 0.01 for x in xrange(10)]

Output:

[0.0, 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09]
answered May 27, 2019 by Keshav

Related Questions In Python

0 votes
1 answer

Python error "TypeError: range() integer end argument expected, got numpy.float64."

Hi @Kashish, try something like this: for i ...READ MORE

answered May 27, 2019 in Python by Harish
2,971 views
0 votes
1 answer

Python error "TypeError: 'encoding' is an invalid keyword argument for this function"

Trying using the io module for this ...READ MORE

answered Aug 2, 2019 in Python by Vaishali

edited Oct 7, 2021 by Sarfaraz 14,668 views
0 votes
1 answer

Error:Expected view to be called with a URL keyword argument named “pk”

Hello @kartik, View functions are called with the ...READ MORE

answered Jul 2, 2020 in Python by Niroj
• 82,840 points
8,507 views
0 votes
1 answer

TypeError: Expected Ptr<cv::UMat> for argument '%s' ''

src is the first argument to cv2.cvtColor. The error you ...READ MORE

answered Oct 15, 2020 in Python by anonymous
• 65,770 points
7,758 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,434 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
4,067 views
0 votes
1 answer

Error saying "TypeError: descriptor object needs an argument"

The error is pretty straight forward, toy ...READ MORE

answered May 28, 2019 in Python by Alisha
13,535 views
0 votes
1 answer

text = _whitespace_only_re.sub('', text) TypeError: expected string or bytes-like object

This seems like an issue with textwrap ...READ MORE

answered Feb 13, 2019 in Python by Omkar
• 69,220 points
8,982 views
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